From fdbdb1151457a59bc6598de4b98b12aa522b4134 Mon Sep 17 00:00:00 2001 From: Jeff Welch Date: Mon, 9 Mar 2015 03:54:19 -0400 Subject: [PATCH] Fix #69202: FILTER_FLAG_STRIP_BACKTICK ignored unless other flags are used. --- ext/filter/sanitizing_filters.c | 2 +- ext/filter/tests/bug69202.phpt | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ext/filter/tests/bug69202.phpt diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index f786f29ce7..43241cc1ef 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 0000000000..992298611f --- /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``" -- 2.40.0