From: Sean Bright Date: Sun, 29 Apr 2001 13:16:05 +0000 (+0000) Subject: Really fix bug #10362. X-Git-Tag: php-4.0.6RC1~265 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=596e8208be79661fef0c616db07817590ea75783;p=php Really fix bug #10362. # My previous fix caused a segfault when there were parens in an unallowed # tag :( Thanks Andi. --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 2daac404af..52274dc248 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2768,7 +2768,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo lc = '('; br++; } - } else if (state == 1) { + } else if (allow && state == 1) { *(tp++) = c; } else if (state == 0) { *(rp++) = c; @@ -2781,7 +2781,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo lc = ')'; br--; } - } else if (state == 1) { + } else if (allow && state == 1) { *(tp++) = c; } else if (state == 0) { *(rp++) = c;