summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-03-18 10:48:43 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-03-18 10:48:43 +0100
commit4be867e9103a415c598d5a15f95fec274d1b7825 (patch)
tree8861ac225063f3535fa11443fea19d5ec5196d73 /ext/pcre/php_pcre.c
parenta08847ab39bb512d500cf196981a3e8780c83600 (diff)
downloadphp-git-4be867e9103a415c598d5a15f95fec274d1b7825.tar.gz
Fix locale switch back to C in pcre
The compile context is shared between patterns, so we need to set the character tables unconditionally in case we switched from a non-C locale to the C locale.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 19b1069978..7b38ac43d7 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -767,8 +767,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in
zend_hash_add_ptr(&char_tables, _k, (void *)tables);
zend_string_release(_k);
}
- pcre2_set_character_tables(cctx, tables);
}
+ pcre2_set_character_tables(cctx, tables);
/* Set extra options for the compile context. */
if (PHP_PCRE_DEFAULT_EXTRA_COPTIONS != extra_coptions) {