cvs: php-src(PHP_5_2) /ext/standard string.c /ext/standard/tests/strings bug40704.phpt

From: Date: Sat, 03 Mar 2007 15:46:29 +0000
Subject: cvs: php-src(PHP_5_2) /ext/standard string.c /ext/standard/tests/strings bug40704.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-43367@lists.php.net to get a copy of this message
iliaa Sat Mar 3 15:46:29 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings bug40704.phpt Modified files: /php-src/ext/standard string.c Log: Fixed bug #40704 (strip_tags() does not handle single quotes correctly) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.44&r2=1.445.2.14.2.45&diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.445.2.14.2.44 php-src/ext/standard/string.c:1.445.2.14.2.45 --- php-src/ext/standard/string.c:1.445.2.14.2.44 Tue Feb 27 03:28:16 2007 +++ php-src/ext/standard/string.c Sat Mar 3 15:46:29 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.445.2.14.2.44 2007/02/27 03:28:16 iliaa Exp $ */ +/* $Id: string.c,v 1.445.2.14.2.45 2007/03/03 15:46:29 iliaa Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -4211,7 +4211,7 @@ switch (state) { case 1: /* HTML/XML */ lc = '>'; - state = 0; + in_q = state = 0; if (allow) { tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = '>'; @@ -4226,19 +4226,19 @@ case 2: /* PHP */ if (!br && lc != '\"' && *(p-1) == '?') { - state = 0; + in_q = state = 0; tp = tbuf; } break; case 3: - state = 0; + in_q = state = 0; tp = tbuf; break; case 4: /* JavaScript/CSS/etc... */ if (p >= buf + 2 && *(p-1) == '-' && *(p-2) == '-') { - state = 0; + in_q = state = 0; tp = tbuf; } break; @@ -4263,7 +4263,7 @@ tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = c; } - if (p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) { + if (state && p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) { if (in_q) { in_q = 0; } else { http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug40704.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/strings/bug40704.phpt +++ php-src/ext/standard/tests/strings/bug40704.phpt

« previous php.cvs (#43367) next »