summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-08 16:14:19 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-08 16:14:19 +0200
commit571a3bfc6c155ad5c13ddbcc9c0518eea4928f35 (patch)
treee3d007cbd3968854ff347e9cbea7fdc76022fe09 /ext/pcre/php_pcre.c
parent31c3b0c7cc38453763e8f8d33baa214de906d60f (diff)
parent68b26ff8cf2390ba5b7565b6624485f2ee6afbf6 (diff)
downloadphp-git-571a3bfc6c155ad5c13ddbcc9c0518eea4928f35.tar.gz
Merge branch 'PHP-7.4'
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index ad852f7c4b..1e5f6105ea 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -556,7 +556,7 @@ static zend_always_inline size_t calculate_unit_length(pcre_cache_entry *pce, ch
/* {{{ pcre_get_compiled_regex_cache
*/
-PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware)
{
pcre2_code *re = NULL;
uint32_t coptions = 0;
@@ -577,7 +577,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
zend_string *key;
pcre_cache_entry *ret;
- if (BG(locale_string) &&
+ if (locale_aware && BG(locale_string) &&
(ZSTR_LEN(BG(locale_string)) != 1 && ZSTR_VAL(BG(locale_string))[0] != 'C')) {
key = zend_string_alloc(ZSTR_LEN(regex) + ZSTR_LEN(BG(locale_string)) + 1, 0);
memcpy(ZSTR_VAL(key), ZSTR_VAL(BG(locale_string)), ZSTR_LEN(BG(locale_string)) + 1);
@@ -858,6 +858,14 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
}
/* }}} */
+/* {{{ pcre_get_compiled_regex_cache
+ */
+PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
+{
+ return pcre_get_compiled_regex_cache_ex(regex, 1);
+}
+/* }}} */
+
/* {{{ pcre_get_compiled_regex
*/
PHPAPI pcre2_code *pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count)