- Fixed PECL bug #6124: Crash on HTML tags when using FS_STRING
authorfoobar <sniper@php.net>
Thu, 1 Dec 2005 16:24:19 +0000 (16:24 +0000)
committerfoobar <sniper@php.net>
Thu, 1 Dec 2005 16:24:19 +0000 (16:24 +0000)
ext/filter/sanitizing_filters.c

index 827d88c98459c16792dbd7009d4932266460a6a8..1b5b920d6da9a734b703e24ac175bd8d4d95250b 100644 (file)
@@ -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);