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

Bug #1843 QF strips backslashes in file names
Submitted: 2004-07-11 11:53 UTC
From: wiesemann Assigned: avb
Status: Closed Package: HTML_QuickForm
PHP Version: Irrelevant OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-07-11 11:53 UTC] wiesemann
Description: ------------ Working with the file element on Windows gives broken "tmp_name" value: D:/phptempphp2C.tmp instead of D:/phptemp/php2C.tmp (or D:/phptemp\php2C.tmp which causes the error) Moving the files works without problems but _ruleIsUploadedFile() returns always false because is_uploaded_file($elementValue['tmp_name']) fails with the broken "tmp_name" value. Replacing '\' with '/' before the call to $this->_submitFiles = $this->_recursiveFilter('stripslashes', $_FILES); (line 260 of QuickForm.php) should solve this.

Comments

 [2004-09-28 14:43 UTC] chubu at zonaphp dot com
I've stepped into the same problem. It seems to me that only the 'name' element of a $_FILES item should be passed trough stripslashes. At most you can also process 'type', but 'tmp_name' shouldn't be processed at all. The value contained in there is generated at the server so it never gets slashes added to it.
 [2004-10-10 11:09 UTC] avb
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.