Fix regression in ICU-mode UTF-8 verification: U+FFFF is forbidden
[lhc/web/wiklou.git] / includes / normal / CleanUpTest.php
index badade6..e9156ab 100644 (file)
@@ -330,6 +330,14 @@ class CleanUpTest extends PHPUnit_TestCase {
                        bin2hex( $expect ),
                        bin2hex( UtfNormal::cleanUp( $text ) ) );
        }
+
+       function testForbiddenRegression() {
+               $text   = "\xef\xbf\xbf"; # U+FFFF, illegal char
+               $expect = "\xef\xbf\xbd";
+               $this->assertEquals(
+                       bin2hex( $expect ),
+                       bin2hex( UtfNormal::cleanUp( $text ) ) );
+       }
 }