From: Ilia Alshanetsky Date: Sun, 1 May 2005 19:49:40 +0000 (+0000) Subject: MFH: Fixed bug #32608 (html_entity_decode() converts single quotes even if X-Git-Tag: php-5.0.5RC1~337 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=feb4c902225ffebd5c87bb77edcce0b1fdebf574;p=php MFH: Fixed bug #32608 (html_entity_decode() converts single quotes even if ENT_NOQUOTES is given). --- diff --git a/NEWS b/NEWS index 5b1094b6dc..536d04254a 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,8 @@ PHP NEWS can crash PHP). (Jani) - Fixed bug #32615 (Segfault in replaceChild() using fragment when previousSibling is NULL). (Rob) +- Fixed bug #32608 (html_entity_decode() converts single quotes even if + ENT_NOQUOTES is given). (Ilia) - Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani) - Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). (Ilia) diff --git a/ext/standard/html.c b/ext/standard/html.c index 05e2c38512..720a494e97 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -117,7 +117,7 @@ static entity_table_t ent_uni_338_402[] = { "Yuml", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, */ - /* 400 (0x0190)*/ + /* 400 (0x0192)*/ NULL, NULL, "fnof" }; @@ -988,7 +988,11 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new if ((code >= 0x80 && code < 0xa0) || code > 0xff) { invalid_code = 1; } else { - *(q++) = code; + if (code == 39 || !quote_style) { + invalid_code = 1; + } else { + *(q++) = code; + } } break;