From b1deb98c42328488cfce61d49d9607ed44fff7a4 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 26 Dec 2018 17:11:27 +0100 Subject: Fixed bug #77338 Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These options are intended to be passed to pcre2_match. However, we do not have any flags that actually need to be set during matching (all relevant flags are set during compilation), and the preg_flags value is used for PHP-specific flags instead. This parameter should be removed entirely in master to avoid confusion. --- ext/pcre/php_pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index ff86458fbf..a7c1a93646 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -867,7 +867,7 @@ PHPAPI pcre2_code *pcre_get_compiled_regex(zend_string *regex, uint32_t *capture pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); if (preg_options) { - *preg_options = pce ? pce->preg_options : 0; + *preg_options = 0; } if (capture_count) { *capture_count = pce ? pce->capture_count : 0; @@ -884,7 +884,7 @@ PHPAPI pcre2_code* pcre_get_compiled_regex_ex(zend_string *regex, uint32_t *capt pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); if (preg_options) { - *preg_options = pce ? pce->preg_options : 0; + *preg_options = 0; } if (compile_options) { *compile_options = pce ? pce->compile_options : 0; -- cgit v1.2.1