From: Ilia Alshanetsky Date: Tue, 22 Dec 2009 02:04:12 +0000 (+0000) Subject: Fixed bug #45599 (strip_tags() truncates rest of string with invalid attribute). X-Git-Tag: php-5.3.2RC1~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=800519fcbb42c93b2c2dd239a4f973cfd5c4f153;p=php Fixed bug #45599 (strip_tags() truncates rest of string with invalid attribute). --- diff --git a/NEWS b/NEWS index 06a630bf08..aa955de615 100644 --- a/NEWS +++ b/NEWS @@ -134,6 +134,8 @@ PHP NEWS - Fixed bug #49174 (crash when extending PDOStatement and trying to set queryString property). (Felipe) - Fixed bug #47848 (importNode doesn't preserve attribute namespaces). (Rob) +- Fixed bug #45599 (strip_tags() truncates rest of string with invalid + attribute). (Ilia, hradtke) - Fixed bug #45120 (PDOStatement->execute() returns true then false for same statement). (Pierrick) - Fixed bug #34852 (Failure in odbc_exec() using oracle-supplied odbc diff --git a/ext/standard/string.c b/ext/standard/string.c index c6e85adc8c..33aa8e1c4b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4381,7 +4381,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = c; } - if (state && p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) { + if (state && p != buf && (state == 1 || *(p-1) != '\\') && (!in_q || *p == in_q)) { if (in_q) { in_q = 0; } else {