diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-24 05:21:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-24 05:21:56 +0000 |
commit | 765d0572a24fc454989ec119cbaa1c089cd34bfa (patch) | |
tree | c6430a8867c3c29212ca43e7e28839fbcf3b4d78 /includes | |
parent | 403485170bb17f08a0f077789babd74174009b72 (diff) | |
download | brdo-765d0572a24fc454989ec119cbaa1c089cd34bfa.tar.gz brdo-765d0572a24fc454989ec119cbaa1c089cd34bfa.tar.bz2 |
- Patch #471142 by stella: code style fixes.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/unicode.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/unicode.inc b/includes/unicode.inc index f25f472d2..8c2f64970 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -207,7 +207,9 @@ function drupal_truncate_bytes($string, $len) { if ((ord($string[$len]) < 0x80) || (ord($string[$len]) >= 0xC0)) { return substr($string, 0, $len); } - while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0) {}; + // Scan backwards to beginning of the byte sequence. + while (--$len >= 0 && ord($string[$len]) >= 0x80 && ord($string[$len]) < 0xC0); + return substr($string, 0, $len); } |