diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index f786f29ce76..43241cc1eff 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -115,7 +115,7 @@ static void php_filter_strip(zval *value, zend_long flags) zend_string *buf; /* Optimization for if no strip flags are set */ - if (! ((flags & FILTER_FLAG_STRIP_LOW) || (flags & FILTER_FLAG_STRIP_HIGH)) ) { + if (!(flags & (FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK))) { return; } diff --git a/ext/filter/tests/bug69202.phpt b/ext/filter/tests/bug69202.phpt new file mode 100644 index 00000000000..992298611fb --- /dev/null +++ b/ext/filter/tests/bug69202.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #69202 (FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(3) "abc" +string(3) "abc" +string(3) "abc" +string(9) "``a`b`c``"