Changeset 5972


Ignore:
Timestamp:
01/25/12 02:16:41 (4 months ago)
Author:
vain
Message:
  • added validator minlength
  • updated comments
Location:
trunk/core/viewhelper/form/validators
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/viewhelper/form/validators/maxlength.php

    r5923 r5972  
    4646    } 
    4747 
     48    /** 
     49     * Setter for the maximum length of the string. 
     50     * 
     51     * @param integer $maxlength 
     52     */ 
    4853    public function setMaxlength($maxlength) 
    4954    { 
    50         $this->maxlength = $maxlength; 
     55        $this->maxlength = (int) $maxlength; 
    5156    } 
    5257 
     
    8186    public function processValidationLogic($value) 
    8287    { 
    83         $length = self::getStringLength($value); 
    84  
    85         if ($length > $this->getMaxlength()) 
     88        if (self::getStringLength($value) >= $this->getMaxlength()) 
    8689        { 
    8790            return false; 
Note: See TracChangeset for help on using the changeset viewer.