src/Service/validateService.php
public function shorterThan($value, $max)
    {
        $this->errorMessage = null;
        $result = false;
        if (function_exists("mb_strlen")) {
            if (mb_strlen($value, 'UTF-8') < $max) {
                $result = true;
            }
        } else {
            if (strlen($value) < $max) {
                $result = true;
            }
        }
        if (!$result) {
            $this->errorMessage = MessageHelper::getMessage("VALIDATESVC_SHORTER_THAN", array($this->fieldNameMask, $max));
        }
        return $result;
    }
public function shorterThan($value, $max)
    {
        $this->errorMessage = null;
        $result = false;
        if (function_exists("mb_strlen")) {
            if (mb_strlen($value, 'UTF-8') < $max) {
                $result = true;
            }
        } else {
            if (strlen($value) < $max) {
                $result = true;
            }
        }
        if (!$result) {
            $this->errorMessage = MessageHelper::getMessage("VALIDATESVC_SHORTER_THAN", array($this->fieldNameMask, $max));
        }
        return $result;
    }
Function to check if a value is shorter than the $max length

@param string $value
@param integer $max
@return boolean Valid?