moriyoshi Sun Jan 19 06:32:55 2003 EDT Added files: /php4/ext/standard/tests/strings bug21744.phpt
Modified files: /php4/ext/standard string.c Log: Fixed bug #21744(21741) Added test case for the bug Index: php4/ext/standard/string.c diff -u php4/ext/standard/string.c:1.347 php4/ext/standard/string.c:1.348 --- php4/ext/standard/string.c:1.347 Sat Jan 18 15:01:46 2003 +++ php4/ext/standard/string.c Sun Jan 19 06:32:54 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.347 2003/01/18 20:01:46 iliaa Exp $ */ +/* $Id: string.c,v 1.348 2003/01/19 11:32:54 moriyoshi Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3630,8 +3630,16 @@ state = 3; lc = c; } else { - *(rp++) = c; - } + if (state == 0) { + *(rp++) = c; + } else if (allow && state == 1) { + *(tp++) = c; + if ( (tp-tbuf) >= PHP_TAG_BUF_SIZE ) { + /* prevent buffer overflows */ + tp = tbuf; + } + } + } break; case '?': Index: php4/ext/standard/tests/strings/bug21744.phpt +++ php4/ext/standard/tests/strings/bug21744.phpt --TEST-- Bug #21744 (strip_tags misses exclamation marks in alt text) --FILE-- <?php $test = <<< HERE <a href="test?test\\!!!test">test</a> <!-- test --> HERE; print strip_tags($test, ''); print strip_tags($test, '<a>'); ?> --EXPECT-- test <a href="test?test\!!!test">test</a> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php