PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Upload » Bug #2291

typo in example and wrong return result of _evalValidExtensions()

Details

Submitted2004-09-06 14:42 UTC
Fromvolker dot buzek at rrze dot uni-erlangen dot de
Assignedantonio
StatusClosed
PackageHTTP_Upload
PHP Version5.0.1
OSSolaris 9
Roadmaps(Not assigned)

Comments

[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
*/

[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