Skip to content
Browse files

Revert "Enabling multibyte support on `lengthBetween` validation rule."

This will be re-added in a differnt way in the g11n boostrap so there's
no dependency on a class outside util.

This reverts commit eb719b6.
  • Loading branch information...
1 parent cdec5e4 commit 1792f6222fb990c739b47173d4eea2c450d0e374 @davidpersson davidpersson committed with nateabele Jan 28, 2012
Showing with 2 additions and 8 deletions.
  1. +2 −8 util/Validator.php
View
10 util/Validator.php
@@ -9,7 +9,6 @@
namespace lithium\util;
use lithium\util\Set;
-use lithium\g11n\Multibyte;
use InvalidArgumentException;
/**
@@ -135,18 +134,13 @@
* All rules operating on strings have been created with the possibility of
* UTF-8 encoded input in mind. A default PHP binary and an enabled Lithium
* g11n bootstrap will make these rules work correctly in any case. Should you
- * ever experience odd behavior following paragraphs with implementation
+ * ever experience odd behavior following paragraph with implementation
* details might help you to track to the cause.
*
* The rules `alphaNumeric` and `money` rely on additional functionality of
* PCRE to validate UTF-8 encoded strings. As no PCRE feature detection is
* done, having this feature enabled in PCRE isn't optional. Please ensure
* you've got PCRE compiled with UTF-8 support.
- *
- * The `lengthBetween` rule optionally makes use of Lithim's `Multibyte` class
- * to validate UTF-8 encoded strings if it iss configured. Make sure you've did
- * configured it g11n boostrap to make this rule automatically work with UTF-8
- * encoded strings.
*/
class Validator extends \lithium\core\StaticObject {
@@ -282,7 +276,7 @@ public static function __init() {
return in_array($value, $options['list']);
},
'lengthBetween' => function($value, $format, $options) {
- $length = Multibyte::config() ? Multibyte::strlen($value) : strlen($value);
+ $length = strlen($value);
$options += array('min' => 1, 'max' => 255);
return ($length >= $options['min'] && $length <= $options['max']);
},

0 comments on commit 1792f62

Please sign in to comment.
Something went wrong with that request. Please try again.