]> granicus.if.org Git - php/commitdiff
Fixed bug #45599 (strip_tags() truncates rest of string with invalid attribute).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 22 Dec 2009 02:04:12 +0000 (02:04 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 22 Dec 2009 02:04:12 +0000 (02:04 +0000)
NEWS
ext/standard/string.c

diff --git a/NEWS b/NEWS
index 06a630bf08fb99c525ce7152652f5967c3ece5ae..aa955de61575227356c9573a87a4d9a2cf475f47 100644 (file)
--- 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
index c6e85adc8cd983d5dfcebd499078595952e740e6..33aa8e1c4b11f1d89bd72823c1306ef9d9a99a1d 100644 (file)
@@ -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 {