Ticket #593 (closed Bug: wontfix)

Opened 7 months ago

Last modified 6 months ago

Form upload value set incorrectly.

Reported by: tterragcnoom Owned by: Shadowhand
Priority: minor Milestone: 2.1.2
Component: Modules:Forge Version: SVN HEAD
Keywords: upload forge Cc: garrett@…

Description

if validate is called more than once (and it's called on render, so it most probably is). The value of uploads is set incorrectly.

on line 94 of Form_Upload.php it should be: $filename = preg_replace('/\s+/', '_', $filename);

on line 102 of Form_Upload.php it should be: $filepath = $this->directory.'uploadfile-'.uniqid(time()).'-'.$filename;

I think :)

Change History

Changed 7 months ago by tterragcnoom

This seems to be a bigger problem actually because calling validate more than once attempts to move the file more than once (which will obviously fail) but will set the name of the file incorrectly (because a file of that name already exists once validate was already called). Maybe a static variable that keeps track whether or not validate has been called or not?

Changed 6 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to wontfix

The validate method should never be called more than once per page load.

Note: See TracTickets for help on using tickets.