From 27e9c05e8108fe6c184178997176896fb91a3451 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 26 Dec 2018 17:20:13 +0100 Subject: Remove preg_options param from pcre_get_compiled_regex() This parameter is always zero and not necessary to call pcre2_match. I'm leaving the parameter behind on the _ex() variant, so the preg_flags are still accessible in some way. --- ext/pcre/php_pcre.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index a7c1a93646..da5b69ed55 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -862,13 +862,10 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex) /* {{{ pcre_get_compiled_regex */ -PHPAPI pcre2_code *pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count, uint32_t *preg_options) +PHPAPI pcre2_code *pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count) { pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); - if (preg_options) { - *preg_options = 0; - } if (capture_count) { *capture_count = pce ? pce->capture_count : 0; } @@ -884,7 +881,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 = 0; + *preg_options = pce ? pce->preg_options : 0; } if (compile_options) { *compile_options = pce ? pce->compile_options : 0; -- cgit v1.2.1