iliaa Tue Feb 13 02:16:22 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings bug40432.phpt
Modified files: /php-src/ext/standard string.c /php-src NEWS Log: Fixed bug #40432 (strip_tags() fails with greater than in attribute). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.39&r2=1.445.2.14.2.40&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.39 php-src/ext/standard/string.c:1.445.2.14.2.40 --- php-src/ext/standard/string.c:1.445.2.14.2.39 Sat Feb 10 00:48:28 2007 +++ php-src/ext/standard/string.c Tue Feb 13 02:16:22 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.445.2.14.2.39 2007/02/10 00:48:28 tony2001 Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.40 2007/02/13 02:16:22 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -4130,7 +4130,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, int allow_len, zend_bool allow_tag_spaces) { char *tbuf, *buf, *p, *tp, *rp, c, lc; - int br, i=0, depth=0; + int br, i=0, depth=0, in_q = 0; int state = 0; if (stateptr) @@ -4164,7 +4164,7 @@ if (allow) { tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = '<'; - } + } } else if (state == 1) { depth++; } @@ -4203,7 +4203,11 @@ depth--; break; } - + + if (in_q) { + break; + } + switch (state) { case 1: /* HTML/XML */ lc = '>'; @@ -4259,6 +4263,9 @@ tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = c; } + if (*(p-1) != '\\') { + in_q = !in_q; + } break; case '!': http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.533&r2=1.2027.2.547.2.534&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.533 php-src/NEWS:1.2027.2.547.2.534 --- php-src/NEWS:1.2027.2.547.2.533 Mon Feb 12 20:30:51 2007 +++ php-src/NEWS Tue Feb 13 02:16:22 2007 @@ -5,6 +5,7 @@ - Upgraded PCRE to version 7.0 (Nuno) - Add --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) +- Fixed bug #40432 (strip_tags() fails with greater than in attribute). (Ilia) - Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty methods). (Tony) - Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug40432.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/strings/bug40432.phpt +++ php-src/ext/standard/tests/strings/bug40432.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php