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

Bug #2291 typo in example and wrong return result of _evalValidExtensions()
Submitted: 2004-09-06 14:42 UTC
From: volker dot buzek at rrze dot uni-erlangen dot de Assigned: antonio
Status: Closed Package: HTTP_Upload
PHP Version: 5.0.1 OS: Solaris 9
Roadmaps: (Not assigned)    
Subscription  


 [2004-09-06 14:42 UTC] volker dot buzek at rrze dot uni-erlangen dot de
Description: ------------ {PEAR}/HTTP_Upload/docs/upload_example.php Check for GET "submit" var, but form is submitted via POST: line 2: <form [...] method="post" enctype="multipart/form-data"> ^^^^ line 14: if (!isset($_GET["submit"])) { ^^^^^^^^^^ {PEAR}/HTTP_Upload/ Upload.php line 868: return false; ^^^^ function _evalValidExtensions() needs to return true if mode==accept and the supplied extension array is _not_ found in $this->getProp('ext') Reproduce code: --------------- $file->setValidExtensions(array("png","PNG"),"accept"); $return = $file->_evalValidExtensions(); /* $retrun == FALSE if file with extension .png was supplied */ Expected result: ---------------- $file->setValidExtensions(array("png","PNG"),"accept"); $return = $file->_evalValidExtensions(); /* $retrun == TRUE if file with extension .png was supplied */ Actual result: -------------- $file->setValidExtensions(array("png","PNG"),"accept"); $return = $file->_evalValidExtensions(); /* $retrun == FALSE if file with extension .png was supplied */

Comments

 [2004-09-14 12:31 UTC] antonio
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. 1. The example sends the submit var via get ... <form action="<?php echo $_SERVER['PHP_SELF'];?>?submit=1" method="post" enctype="multipart/form-data"> 2. I've tested the _evalValidExtensions() and it's returning the expected result. Can you please try to test your code with the latest CVS version?
 [2004-09-15 06:33 UTC] volker dot buzek at rrze dot uni-erlangen dot de
with latest CVS: 1) verified and working, already prior to current CVS - overlooked the variable appended to the URL in the action attribute 2) verified and working