Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0b4

Bug #6678 Missing return statement in HTTP_Upload::isMissing()
Submitted: 2006-02-03 04:00 UTC
From: owen at op-design dot com Assigned: wenz
Status: Closed Package: HTTP_Upload (version 0.9.1)
PHP Version: 4.4.2 OS: RedHat Enterprise 3
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 50 - 2 = ?

 
 [2006-02-03 04:00 UTC] owen at op-design dot com
Description: ------------ In the isMissing function in HTTP_Upload, a return statement on line 475 of Upload.php is missing. This makes it so that if an error is raised, it cannot be caught using the normal method to check for an error. Like 475 is: $this->raiseError('NO_USER_FILE'); It should be: return $this->raiseError('NO_USER_FILE'); Test script: --------------- ---------- HTML Upload Form --------- <form enctype="multipart/form-data" action="myupload.php" method="POST"> <input type="hidden" name="step" value="1"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Upload File: <input name="f[]" type="file" /> <p><input type="submit" value="Upload >>" /> </form> ----------- myupload.php ----------- require_once 'HTTP/Upload.php'; $upload = new HTTP_Upload('en'); $upload_error = $upload->isMissing(); if (PEAR::isError($upload_error)) { echo "No files were uploaded. Please go back and try again."; } Expected result: ---------------- An error should be raised. No error will be raised if no files are attached. Actual result: -------------- No error is raised.

Comments

 [2006-02-05 14:17 UTC] wenz
thanks for the report; this issue has already been fixed in CVS.