PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_Upload » Bug #7499

Error in HTTP_Upload::isMissing() on determining uploaded files

Details

Submitted2006-04-27 08:27 UTC
Fromalpaxo at aiken dot com dot ua
Assignedwenz
StatusClosed
PackageHTTP_Upload
PHP VersionIrrelevant
OSany
Roadmaps(Not assigned)

Comments

[2006-04-27 08:27 UTC] alpaxo at aiken dot com dot ua

Description:
------------
Description:
------------
// $Id: Upload.php,v 1.54 2006/04/06 08:43:58 wenz Exp $

Error in HTTP_Upload::isMissing() on determining uploaded files on l.526-529:
} else { //one file
$size = $value['size'];dump($value);
$error = $value['error'];
}

If we have 2 file in $this->post_files, for example:
array(11) {
["p58i0"]=>
array(5) {
["name"]=>
string(23) "test.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(15) "/tmp\php21A.tmp"
["error"]=>
int(0)
["size"]=>
int(29867)
}
["p58i1"]=>
array(5) {
["name"]=>
string(0) ""
["type"]=>
string(0) ""
["tmp_name"]=>
string(0) ""
["error"]=>
int(4)
["size"]=>
int(0)
}
}

then values of p58i0 will be overwritten by p58i1, as result - having $this->raiseError('NO_USER_FILE');

Possible solution:
1. l.526:
}else{
replace with
}elseif(!empty($value['name'])){
2. l.527
$size = $value['size'];
replace with
$size += $value['size'];