diff --git a/ext/mbstring/tests/utf8_mobile_encodings.phpt b/ext/mbstring/tests/utf8_mobile_encodings.phpt index 918e897696d..21107ce5f08 100644 --- a/ext/mbstring/tests/utf8_mobile_encodings.phpt +++ b/ext/mbstring/tests/utf8_mobile_encodings.phpt @@ -31,6 +31,7 @@ $badUTF8 = array( // Multi-byte characters which end too soon and go to ASCII "\xDFA" => "\x00\x00\x00%\x00\x00\x00A", "\xEF\xBFA" => "\x00\x00\x00%\x00\x00\x00A", + "\xF0\xBFA" => "\x00\x00\x00%\x00\x00\x00A", "\xF0\xBF\xBFA" => "\x00\x00\x00%\x00\x00\x00A", // Multi-byte characters which end too soon and go to another MB char diff --git a/ext/mbstring/tests/utf_encodings.phpt b/ext/mbstring/tests/utf_encodings.phpt index 490048058d9..92a9f4f1f56 100644 --- a/ext/mbstring/tests/utf_encodings.phpt +++ b/ext/mbstring/tests/utf_encodings.phpt @@ -778,6 +778,7 @@ $invalid = array( // Multi-byte characters which end too soon and go to ASCII "\xDFA" => "\x00\x00\x00%\x00\x00\x00A", "\xEF\xBFA" => "\x00\x00\x00%\x00\x00\x00A", + "\xF0\xBFA" => "\x00\x00\x00%\x00\x00\x00A", "\xF0\xBF\xBFA" => "\x00\x00\x00%\x00\x00\x00A", // Multi-byte characters which end too soon and go to another MB char @@ -785,6 +786,11 @@ $invalid = array( "\xEF\xBF\xDF\xBF" => "\x00\x00\x00%\x00\x00\x07\xFF", "\xF0\xBF\xBF\xDF\xBF" => "\x00\x00\x00%\x00\x00\x07\xFF", + // Multi-byte characters which end too soon and go to a junk byte + // (Which isn't even valid to start a new character) + "\xF0\xBF\xBF\xFF" => "\x00\x00\x00%", + "\xF0\xBF\xFF" => "\x00\x00\x00%", + // Continuation bytes which appear outside of a MB char "\x80" => "\x00\x00\x00%", "A\x80" => "\x00\x00\x00A\x00\x00\x00%",