From 8efe66008c882d85ac79eadacab6baab47ab89af Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 6 Nov 2004 03:00:29 +0000 Subject: [PATCH] Don't run the control characters through the invariant test, as they are stripped by cleanUp() for XML safety. --- includes/normal/UtfNormalTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/normal/UtfNormalTest.php b/includes/normal/UtfNormalTest.php index 6aea3a40d5..90c2ea15df 100644 --- a/includes/normal/UtfNormalTest.php +++ b/includes/normal/UtfNormalTest.php @@ -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; } -- 2.20.1