From: Brion Vibber Date: Sun, 14 Nov 2004 02:24:44 +0000 (+0000) Subject: Fix UTF-8 validation bug where some cases didn't get replacement chars inserted correctly X-Git-Tag: 1.5.0alpha1~1342 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=7bf6095d73d2117f4ebc60419a9cf809f9072738;p=lhc%2Fweb%2Fwiklou.git Fix UTF-8 validation bug where some cases didn't get replacement chars inserted correctly --- diff --git a/includes/normal/CleanUpTest.php b/includes/normal/CleanUpTest.php index 64f7b63904..2dd8d5616f 100644 --- a/includes/normal/CleanUpTest.php +++ b/includes/normal/CleanUpTest.php @@ -1,4 +1,8 @@ assertEquals( + bin2hex( $expect ), + bin2hex( UtfNormal::cleanUp( $text ) ) ); + } } diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index 2883342f8e..7dd9072185 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -350,7 +350,6 @@ class UtfNormal { $replace[] = array( UTF8_REPLACEMENT, $base + $i + 1 - strlen( $sequence ), strlen( $sequence ) ); - $base += $chunk; break 2; } else { # Illegal tail byte; abandon the sequence.