@@ 294-304 (lines=11) @@ | ||
291 | * |
|
292 | * @return bool |
|
293 | */ |
|
294 | public static function validateTextMaxLength($fieldName, $maxTextLength) { |
|
295 | $text = trim(strip_tags(Request::getFieldValue($fieldName))); |
|
296 | if (strlen($text) > $maxTextLength) { |
|
297 | Errors::saveErrorFor( |
|
298 | $fieldName, |
|
299 | str_replace("[[1]]", $maxTextLength, \__ERRORS::MAX_TEXT_LENGTH) |
|
300 | ); |
|
301 | ||
302 | return false; |
|
303 | } |
|
304 | ||
305 | return true; |
|
306 | } |
|
307 | ||
@@ 317-327 (lines=11) @@ | ||
314 | * |
|
315 | * @return bool |
|
316 | */ |
|
317 | public static function validateTextMinLength($fieldName, $minTextLength) { |
|
318 | $text = trim(strip_tags(Request::getFieldValue($fieldName))); |
|
319 | if (strlen($text) < $minTextLength) { |
|
320 | Errors::saveErrorFor( |
|
321 | $fieldName, |
|
322 | str_replace("[[1]]", $minTextLength, \__ERRORS::MIN_TEXT_LENGTH) |
|
323 | ); |
|
324 | ||
325 | return false; |
|
326 | } |
|
327 | ||
328 | return true; |
|
329 | } |
|
330 |