]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.2'
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 5 Jul 2018 17:10:24 +0000 (19:10 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 5 Jul 2018 17:10:24 +0000 (19:10 +0200)
1  2 
ext/standard/filters.c

index 143a10396629bb83b5afc9d6cd140b657f132271,55b5a9df51872700115e416719c8aa15032add78..f738ecf762a66924b949912c9f0fc22b1e774b68
@@@ -267,18 -270,20 +270,20 @@@ static php_stream_filter *strfilter_str
                }
        }
  
-       if (php_strip_tags_filter_ctor(inst, ZSTR_VAL(tags_ss.s), ZSTR_LEN(tags_ss.s), persistent) != SUCCESS) {
-               smart_str_free(&tags_ss);
+       if (php_strip_tags_filter_ctor(inst, allowed_tags, persistent) == SUCCESS) {
+               filter = php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
+       } else {
                pefree(inst, persistent);
-               return NULL;
        }
  
-       smart_str_free(&tags_ss);
+       if (allowed_tags) {
+               zend_string_release(allowed_tags);
+       }
  
-       return php_stream_filter_alloc(&strfilter_strip_tags_ops, inst, persistent);
+       return filter;
  }
  
 -static php_stream_filter_factory strfilter_strip_tags_factory = {
 +static const php_stream_filter_factory strfilter_strip_tags_factory = {
        strfilter_strip_tags_create
  };