Home » HTTP » HTTP_Upload » Bug #8656
getFiles() generate error if one of uploaded files haven't been selected
Details
| Submitted | 2006-09-07 15:55 UTC |
|---|---|
| From | s dot kornev at gmail dot com |
| Assigned | wenz |
| Status | Closed |
| Package | HTTP_Upload |
| PHP Version | 4.3.0 |
| OS | WinXP |
| Roadmaps | (Not assigned) |
Comments
[2006-09-07 15:55 UTC] s dot kornev at gmail dot com
Description:
------------
Getting error if one of submitted files haven't been selected
Upload error: You haven't selected any file for uploading.
Test script:
---------------
<?php
/**
* strings 443 - 450 should be patched with this code
*/
// In 4.1 $_FILES isn't initialized when no uploads
// XXX (cox) afaik, in >= 4.1 and <= 4.3 only
if (function_exists('version_compare') &&
version_compare(phpversion(), '4.1', 'ge') && version_compare(phpversion(), '4.3', 'le'))
{
$error = $this->isMissing();
if (PEAR::isError($error)) {
return $error;
}
}
?>
Expected result:
----------------
no errors
Actual result:
--------------
Upload error: You haven't selected any file for uploading.
[2006-09-07 17:55 UTC] s dot kornev at gmail dot com
It doesnt' work for. Cause on NT 5.1(XP) and PHP 4.30
$_FILES is initialized. so patch should be something like
if (function_exists('version_compare') &&
version_compare(phpversion(), '4.1', 'ge') &&
version_compare(phpversion(), '4.3', 'le'))
as I ve written before.
thanks.
[2006-09-07 18:03 UTC] s dot kornev at gmail dot com
changes to bug state open