PhpSpreadsheet/tests/PhpSpreadsheetTests/Reader
oleibman 5de82981d8
Html Reader Not Handling non-ASCII Data Correctly (#2943)
* Html Reader Not Handling non-ASCII Data Correctly

Fix #2942. Code was changed by #2894 because PHP8.2 will deprecate how it was being done. See linked issue for more details. Dom loadhtml assumes ISO-8859-1 in the absence of a charset attribute or equivalent, and there is no way to override that assumption. Sigh. The suggested replacements are unsuitable in one way or another. I think this will work with minimal disruption (replace ampersand, less than, and greater than with entities representing illegal characters, then use htmlentities, then restore ampersand, less than, and greater than).

* Better Implementation

Use regexp to escape non-ASCII. Less kludgey, less reliant on the vagaries of the PHP maintainers.

* Additional Tests

Test non-ASCII outside of cell contents: sheet title, image alt attribute.

* Apply Same Change in Second Location

Forgot to change loadFromString.

* Additional Test

Confirm escaped ampersand is handled correctly.
2022-07-16 22:08:44 -07:00
..
Csv Php/iconv Should Not Treat FFFE/FFFF as Valid (#2910) 2022-07-02 08:53:39 -07:00
Gnumeric Add support for reading Worksheet Visibility for Gnumeric 2022-05-24 14:08:41 +02:00
Html Html Reader Not Handling non-ASCII Data Correctly (#2943) 2022-07-16 22:08:44 -07:00
Ods Add Hidden Worksheet unit tests for other Readers 2022-05-24 14:40:45 +02:00
Security Phpstan Differences from Php7 to Php8, Again (#2665) 2022-03-11 23:28:30 -08:00
Slk Process Comments in Sylk File (#2277) 2021-08-26 11:56:13 -07:00
Utility When image source is a URL, store the URL for use during extraction. (#2072) 2021-06-24 10:50:44 +02:00
Xls Add Hidden Worksheet unit tests for other Readers 2022-05-24 14:40:45 +02:00
Xlsx Move Gridlines from Chart to Axis (#2923) 2022-07-07 21:48:12 -07:00
Xml Phpstan Differences from Php7 to Php8, Again (#2665) 2022-03-11 23:28:30 -08:00
BaseNoLoad.php Coverage Improvements (#2859) 2022-06-01 08:29:56 -07:00
BaseNoLoadTest.php Coverage Improvements (#2859) 2022-06-01 08:29:56 -07:00