From: foobar Date: Thu, 1 Dec 2005 16:24:19 +0000 (+0000) Subject: - Fixed PECL bug #6124: Crash on HTML tags when using FS_STRING X-Git-Tag: RELEASE_2_0_2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b396961daa7910df3a613c6619cd3b005cff231;p=php - Fixed PECL bug #6124: Crash on HTML tags when using FS_STRING --- diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index 827d88c984..1b5b920d6d 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -178,7 +178,12 @@ void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL) /* strip tags, implicitly also removes \0 chars */ new_len = php_strip_tags(Z_STRVAL_P(value), Z_STRLEN_P(value), NULL, NULL, 0); Z_STRLEN_P(value) = new_len; - + + if (new_len == 0) { + Z_TYPE_P(value) = IS_NULL; + return; + } + if (! (flags & FILTER_FLAG_NO_ENCODE_QUOTES)) { /* encode ' and " to numerical entity */ php_filter_encode_html(value, "'\"", 0);