Don't run the control characters through the invariant test, as they are stripped...
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 6 Nov 2004 03:00:29 +0000 (03:00 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 6 Nov 2004 03:00:29 +0000 (03:00 +0000)
includes/normal/UtfNormalTest.php

index 6aea3a4..90c2ea1 100644 (file)
@@ -110,8 +110,9 @@ while( false !== ($line = fgets( $in ) ) ) {
        $cols = explode( ';', $line );
        $char = codepointToUtf8( hexdec( $cols[0] ) );
        $desc = $cols[0] . ": " . $cols[1];
-       if( $char === "\x00" || $char >= UTF8_SURROGATE_FIRST && $char <= UTF8_SURROGATE_LAST ) {
+       if( $char < "\x20" || $char >= UTF8_SURROGATE_FIRST && $char <= UTF8_SURROGATE_LAST ) {
                # Can't check NULL with the ICU plugin, as null bytes fail in C land.
+               # Skip other control characters, as we strip them for XML safety.
                # Surrogates are illegal on their own or in UTF-8, ignore.
                continue;
        }