com php-src: Merge branch 'PHP-7.3' into PHP-7.4: ext/pcre/php _pcre.c ext/pcre/php_pcre.h
| From: | Nikita Popov | Date: | Tue, 08 Oct 2019 14:14:06 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.3' into PHP-7.4: ext/pcre/php _pcre.c ext/pcre/php_pcre.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108811@lists.php.net to get a copy of this message | ||
Commit: 68b26ff8cf2390ba5b7565b6624485f2ee6afbf6
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 8 Oct 2019 16:14:06 +0200
Parents: 9004102b99be4d3811d69ad61149dc2959579e0a 736af5f6602145a267dcd9d795414a6dbffa07dc
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68b26ff8cf2390ba5b7565b6624485f2ee6afbf6
Log:
Merge branch 'PHP-7.3' into PHP-7.4
Changed paths:
MM ext/pcre/php_pcre.c
MM ext/pcre/php_pcre.h
Diff:
diff --cc ext/pcre/php_pcre.c
index 34c8389ebb4,e82dc252b27..d19c7960a66
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@@ -587,7 -551,8 +587,7 @@@ PHPAPI pcre_cache_entry* pcre_get_compi
zend_string *key;
pcre_cache_entry *ret;
- if (BG(locale_string) &&
-#if HAVE_SETLOCALE
+ 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);
@@@ -879,9 -867,17 +879,17 @@@
}
/* }}} */
+ /* {{{ 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, 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);
diff --cc ext/pcre/php_pcre.h
index 1a28d1733a7,9fd8259b401..b375981df3f
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@@ -40,8 -44,9 +40,9 @@@ extern zend_module_entry pcre_module_en
typedef struct _pcre_cache_entry pcre_cache_entry;
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);
-PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, size_t subject_len, zval
*return_value,
+PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval
*return_value,
zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset);
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char
*subject, size_t subject_len, zend_string *replace_str,