summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-12-26 17:20:13 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-12-26 17:20:13 +0100
commit27e9c05e8108fe6c184178997176896fb91a3451 (patch)
treefc2d55695b51206ee95c6f42fadf07285a19498f /ext/pcre/php_pcre.c
parentfc30c0f7adbddd491266fdbf80427c348d249e01 (diff)
downloadphp-git-27e9c05e8108fe6c184178997176896fb91a3451.tar.gz
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.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c7
1 files changed, 2 insertions, 5 deletions
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;