cvs: pear /HTML_QuickForm QuickForm.php

From: Date: Fri, 05 Oct 2007 19:57:32 +0000
Subject: cvs: pear /HTML_QuickForm QuickForm.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-48752@lists.php.net to get a copy of this message
avb Fri Oct 5 19:57:32 2007 UTC Modified files: /pear/HTML_QuickForm QuickForm.php Log: Only omit file validation if the file wasn't uploaded (bug #12014) http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm/QuickForm.php?r1=1.163&r2=1.164&diff_format=u Index: pear/HTML_QuickForm/QuickForm.php diff -u pear/HTML_QuickForm/QuickForm.php:1.163 pear/HTML_QuickForm/QuickForm.php:1.164 --- pear/HTML_QuickForm/QuickForm.php:1.163 Tue May 29 18:34:36 2007 +++ pear/HTML_QuickForm/QuickForm.php Fri Oct 5 19:57:32 2007 @@ -19,7 +19,7 @@ * @author Alexey Borzov <avb@php.net> * @copyright 2001-2007 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: QuickForm.php,v 1.163 2007/05/29 18:34:36 avb Exp $ + * @version CVS: $Id: QuickForm.php,v 1.164 2007/10/05 19:57:32 avb Exp $ * @link http://pear.php.net/package/HTML_QuickForm */ @@ -1526,6 +1526,11 @@ // Fix for bug #3501: we shouldn't validate not uploaded files, either. // Unfortunately, we can't just use $element->isUploadedFile() since // the element in question can be buried in group. Thus this hack. + // See also bug #12014, we should only consider a file that has + // status UPLOAD_ERR_NO_FILE as not uploaded, in all other cases + // validation should be performed, so that e.g. 'maxfilesize' rule + // will display an error if status is UPLOAD_ERR_INI_SIZE + // or UPLOAD_ERR_FORM_SIZE } elseif (is_array($submitValue)) { if (false === ($pos = strpos($target, '['))) { $isUpload = !empty($this->_submitFiles[$target]); @@ -1540,7 +1545,7 @@ ) . "']"; eval("\$isUpload = isset(\$this->_submitFiles['{$base}']['name']{$idx});"); } - if ($isUpload && (!isset($submitValue['error']) || 0 != $submitValue['error'])) { + if ($isUpload && (!isset($submitValue['error']) || UPLOAD_ERR_NO_FILE == $submitValue['error'])) { continue 2; } }

« previous php.pear.cvs (#48752) next »