Zend Framework

Zend_Validate_File_Size, used with only one param require the file to be of exact size

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Not an Issue
  • Affects Version/s: 1.6.0
  • Fix Version/s: 1.6.1
  • Component/s: Zend_Validate_File
  • Labels:
    None

Description

In the doc, the example usage of Zend_Validate_File_Size says "->addValidator('Size', false, 102400) // limit to 100K" (http://framework.zend.com/manual/fr/zend.form.standardElements.html).

I andurstand this as limiting up to 100K not requiring the file to be exactly 100K, Am i wrong ?

By the way, the code of Zend_Validate_File_Size is requiring the file to match exactly the given size, line 110 :
if (empty($max)) {
$max = $min;
}

In my opinion we need a code change to specify only the max limit or a change in the docs.

Activity

Hide
Thomas Weidner added a comment -

The code reads:

if (empty($max)) {
            $max = $min;
            $min = 0;
        }

since 11.August.

Show
Thomas Weidner added a comment - The code reads:
if (empty($max)) {
            $max = $min;
            $min = 0;
        }
since 11.August.
Hide
Thomas Weidner added a comment -

Fixed in past with r10886

Show
Thomas Weidner added a comment - Fixed in past with r10886

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: