Permalink
Browse files

MDL-40267 forms: fix utf8 string length rules

  • Loading branch information...
1 parent 9424bcb commit d320d0b2859c3dcadb62412c1a1afaf939564d87 @danpoltawski danpoltawski committed Nov 5, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/pear/HTML/QuickForm/Rule/Range.php
  2. +1 −1 lib/pear/README_MOODLE.txt
@@ -36,7 +36,7 @@ class HTML_QuickForm_Rule_Range extends HTML_QuickForm_Rule
*/
function validate($value, $options = null)
{
- $length = strlen($value);
+ $length = textlib::strlen($value);
switch ($this->name) {
case 'minlength': return ($length >= $options);
case 'maxlength': return ($length <= $options);
@@ -61,4 +61,4 @@ function getValidationScript($options = null)
} // end func getValidationScript
} // end class HTML_QuickForm_Rule_Range
-?>
+?>
@@ -47,4 +47,4 @@ Full of our custom hacks, no way to upgrade to latest upstream.
Most probably we will stop using this library in the future.
MDL-20876 - replaced split() with explode() or preg_split() where appropriate
-
+MDL-40267 - Moodle textlib strlen functions used for range rule rule to be utf8 safe.

0 comments on commit d320d0b

Please sign in to comment.