mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
This commit is contained in:
commit
68b26ff8cf
2 changed files with 11 additions and 2 deletions
|
@ -565,7 +565,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;
|
||||
|
@ -587,7 +587,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);
|
||||
|
@ -879,6 +879,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)
|
||||
|
|
|
@ -40,6 +40,7 @@ extern zend_module_entry pcre_module_entry;
|
|||
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, zend_string *subject_str, zval *return_value,
|
||||
zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue