From: Scott MacVicar Date: Fri, 25 Jan 2008 18:10:45 +0000 (+0000) Subject: Fix html_entity_decode when converting numeric html entities, the numeric values... X-Git-Tag: RELEASE_1_3_1~293 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23e3baf62da39b3e37ba9b898537f8fbdad63067;p=php Fix html_entity_decode when converting numeric html entities, the numeric values for the extended characters don't correspond to that of windows-1251 and cp866. --- diff --git a/NEWS b/NEWS index 64dd091ad4..2a3689a797 100644 --- a/NEWS +++ b/NEWS @@ -82,6 +82,8 @@ PHP NEWS - Changed exception handling. Now each op_array doesn't contain ZEND_HANDLE_EXCEPTION opcode in the end. (Dmitry) +- Fixed html_entity_decode() incorrectly converting numeric html entities + to different characters with cp1251 and cp866. (Scott) - Fixed possible crash in ext/soap because of uninitialized value. (Zdash Urf) - Fixed bug #43808 (date_create never fails (even when it should)). (Derick) diff --git a/ext/standard/html.c b/ext/standard/html.c index 7014332d8d..795eeba163 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1034,8 +1034,6 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new break; case cs_cp1252: - case cs_cp1251: - case cs_cp866: if (code > 0xff) { invalid_code = 1; } else { @@ -1043,6 +1041,8 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new } break; + case cs_cp1251: + case cs_cp866: case cs_big5: case cs_big5hkscs: case cs_sjis: