Replace create_function with anonymous function

pull/2606/head
Julio Montoya 7 years ago
parent 7c0a032079
commit 1510ec9def
  1. 7
      main/inc/lib/pear/HTML/QuickForm/Rule/MinText.php

@ -14,9 +14,12 @@ class Html_Quickform_Rule_MinText extends HTML_QuickForm_Rule
* @param int $count The minimum number of characters that the text should contain * @param int $count The minimum number of characters that the text should contain
* @return boolean True if text has the minimum number of chars required * @return boolean True if text has the minimum number of chars required
*/ */
function validate($text, $count) public function validate($text, $count)
{ {
$checkMinText = create_function('$a,$b', 'return strlen(utf8_decode($a)) >= $b;'); $checkMinText = function($a, $b) {
return strlen(utf8_decode($a)) >= $b;
};
return $checkMinText($text, $count); return $checkMinText($text, $count);
} }
} }

Loading…
Cancel
Save