Browse Source

Replace create_function with anonymous function

Julio Montoya 6 years ago
parent
commit
1510ec9def
1 changed files with 5 additions and 2 deletions
  1. 5 2
      main/inc/lib/pear/HTML/QuickForm/Rule/MinText.php

+ 5 - 2
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
      * @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);
     }
 }