File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1004,8 +1004,9 @@ static void traverse_for_entities(
1004
1004
/* && code2 == '\0' always true for current maps */ )
1005
1005
goto invalid_code ;
1006
1006
1007
- /* deal with encodings other than utf-8/iso-8859-1 */
1008
- if (!CHARSET_UNICODE_COMPAT (charset )) {
1007
+ /* UTF-8 doesn't need mapping (ISO-8859-1 doesn't either, but
1008
+ * the call is needed to ensure the codepoint <= U+00FF) */
1009
+ if (charset != cs_utf_8 ) {
1009
1010
/* replace unicode code point */
1010
1011
if (map_from_unicode (code , charset , & code ) == FAILURE || code2 != 0 )
1011
1012
goto invalid_code ; /* not representable in target charset */
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Bug #61374: html_entity_decode tries to decode code points that don't exist in ISO-8859-1
3
+ --FILE--
4
+ <?php
5
+ echo html_entity_decode ('Œ ' , 0 , 'ISO-8859-1 ' );
6
+ --EXPECT --
7
+ Œ
You can’t perform that action at this time.
0 commit comments