PhpSpreadsheet/tests/PhpSpreadsheetTests/Shared
oleibman c3f53854b6
Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910)
Fix #2897. We have been relying on iconv/mb_convert_encoding to detect invalid UTF-8, but all techniques designed to validate UTF-8 seem to accept FFFE and FFFF. This PR explicitly converts those characters to FFFD (Unicode substitution character) before validating the rest of the string. It also substitutes one or more FFFD when it detects invalid UTF-8 character sequences.

A comment in the code being change stated that it doesn't handle surrogates. It is right not to do so. The only case where we should see surrogates is reading UTF-16. Additional tests are added to an existing test reading a UTF-16 Csv to demonstrate that surrogates are handled correctly, and that FFFE/FFFF are handled reasonably.
2022-07-02 08:53:39 -07:00
..
Trend Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
CodePageTest.php Xls Reader Handle MACCENTRALEUROPE With or Without Hyphen (#2213) 2021-07-12 03:02:47 +02:00
DateTest.php Eliminate Most Scrutinizer Problems in Test Suite (#2699) 2022-03-21 13:58:42 -07:00
DrawingTest.php Html import dimension conversions (#2152) 2021-06-11 17:29:49 +02:00
FileTest.php Tweaks to Input File Validation (#2217) 2021-07-24 20:44:04 -07:00
FontTest.php Autofit adjustment for indent 2022-05-11 12:33:01 +02:00
OLEReadTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
PasswordHasherTest.php Fix Worksheet Passwords 2021-06-29 09:11:51 -07:00
PasswordReloadTest.php Fix SettingsTest 2021-06-30 11:33:35 -07:00
StringHelperInvalidCharTest.php Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910) 2022-07-02 08:53:39 -07:00
StringHelperTest.php Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910) 2022-07-02 08:53:39 -07:00
TimeZoneTest.php Document Properties - Coverage and 32-bit-safe Timestamps (#2113) 2021-05-30 13:55:58 +02:00