From 1d08a8d157fe76c98abec7664f9eeddf654ff546 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 27 Feb 2007 00:15:21 +0000 Subject: [PATCH] Fixed bug #40637 (Regression in strip_tags() in relation so quote handling) --- ext/standard/string.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index a82aa0c34f5..c65da880877 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4263,8 +4263,12 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); *(tp++) = c; } - if (p != buf && *(p-1) != '\\') { - in_q = !in_q; + if (p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) { + if (in_q) { + in_q = 0; + } else { + in_q = *p; + } } break;