diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-07 18:50:42 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-07 21:26:13 +0200 |
commit | 2414b3d7756f7a4937d845fb2cb64947ab6796c8 (patch) | |
tree | f21ea068d09b700d3f41d7700291469e449d3f57 /ext/pcre/php_pcre.c | |
parent | d38f819647ac0dd9b16c43ce399aa65256a46d0f (diff) | |
download | php-git-2414b3d7756f7a4937d845fb2cb64947ab6796c8.tar.gz |
Ensure ctype_string is NULL for C locale
We already document that this is the case, but currently it's only
true if setlocale() has not been called. Make sure ctype_string is
always NULL, even with an explicit "C" locale call, so we can
more efficiently check whether we are in the "C" locale.
Closes GH-5542.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 611a18bd48..9f67bff14c 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -595,8 +595,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, in zend_string *key; pcre_cache_entry *ret; - if (locale_aware && BG(ctype_string) && - (ZSTR_LEN(BG(ctype_string)) != 1 && ZSTR_VAL(BG(ctype_string))[0] != 'C')) { + if (locale_aware && BG(ctype_string)) { key = zend_string_concat2( ZSTR_VAL(BG(ctype_string)), ZSTR_LEN(BG(ctype_string)), ZSTR_VAL(regex), ZSTR_LEN(regex)); |