summaryrefslogtreecommitdiff
path: root/includes/unicode.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-24 05:21:56 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-24 05:21:56 +0000
commit765d0572a24fc454989ec119cbaa1c089cd34bfa (patch)
treec6430a8867c3c29212ca43e7e28839fbcf3b4d78 /includes/unicode.inc
parent403485170bb17f08a0f077789babd74174009b72 (diff)
downloadbrdo-765d0572a24fc454989ec119cbaa1c089cd34bfa.tar.gz
brdo-765d0572a24fc454989ec119cbaa1c089cd34bfa.tar.bz2
- Patch #471142 by stella: code style fixes.
Diffstat (limited to 'includes/unicode.inc')
-rw-r--r--includes/unicode.inc4
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);
}