iliaa Mon Jan 6 17:13:03 2003 EDT
Added files:
/php4/ext/standard/tests/strings bug21453.phpt
Modified files:
/php4/ext/standard string.c
Log:
Fixed bug #21453 (improper handling of non-terminated <).
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.342 php4/ext/standard/string.c:1.343
--- php4/ext/standard/string.c:1.342 Sat Jan 4 23:29:14 2003
+++ php4/ext/standard/string.c Mon Jan 6 17:13:03 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.342 2003/01/05 04:29:14 iliaa Exp $ */
+/* $Id: string.c,v 1.343 2003/01/06 22:13:03 iliaa Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -3413,6 +3413,9 @@
while (i < len) {
switch (c) {
case '<':
+ if (isspace(*(p + 1))) {
+ goto reg_char;
+ }
if (state == 0) {
lc = '<';
state = 1;
@@ -3552,6 +3555,7 @@
/* fall-through */
default:
+reg_char:
if (state == 0) {
*(rp++) = c;
} else if (allow && state == 1) {
Index: php4/ext/standard/tests/strings/bug21453.phpt
+++ php4/ext/standard/tests/strings/bug21453.phpt
--TEST--
Bug #21453 (handling of non-encoded <)
--FILE--
<?php
$test = "
<table>
<tr><td>first cell before < first cell after</td></tr>
<tr><td>second cell before < second cell after</td></tr>
</table>";
var_dump(strip_tags($test));
?>
--EXPECT--
string(80) "
first cell before < first cell after
second cell before < second cell after
"
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php