| @@ 74-78 (lines=5) @@ | ||
| 71 | */ |
|
| 72 | public function validate($value) |
|
| 73 | { |
|
| 74 | if (is_null($this->encoding) || !function_exists('mb_strlen')) { |
|
| 75 | $actualLength = strlen($value); |
|
| 76 | } else { |
|
| 77 | $actualLength = mb_strlen($value, $this->encoding); |
|
| 78 | } |
|
| 79 | ||
| 80 | if ($actualLength > $this->length) { |
|
| 81 | return $this->error(self::TOO_LONG); |
|
| @@ 81-85 (lines=5) @@ | ||
| 78 | */ |
|
| 79 | public function validate($value) |
|
| 80 | { |
|
| 81 | if (is_null($this->encoding) || !function_exists('mb_strlen')) { |
|
| 82 | $length = strlen($value); |
|
| 83 | } else { |
|
| 84 | $length = mb_strlen($value, $this->encoding); |
|
| 85 | } |
|
| 86 | ||
| 87 | return !$this->tooSmall($length, self::TOO_SHORT) && !$this->tooLarge($length, self::TOO_LONG); |
|
| 88 | } |
|