mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix external pcre2 build (#13662)
PCRE2_EXTRA_CASELESS_RESTRICT is only available as of pcre2 10.43. Note: no check is necessary for pcre2_set_compile_extra_options because it is available since pcre2 10.30, which is the minimum version PHP requires.
This commit is contained in:
parent
cfdbf7743d
commit
d0e15c8502
2 changed files with 8 additions and 0 deletions
|
@ -723,7 +723,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, bo
|
||||||
/* PCRE specific options */
|
/* PCRE specific options */
|
||||||
case 'A': coptions |= PCRE2_ANCHORED; break;
|
case 'A': coptions |= PCRE2_ANCHORED; break;
|
||||||
case 'D': coptions |= PCRE2_DOLLAR_ENDONLY;break;
|
case 'D': coptions |= PCRE2_DOLLAR_ENDONLY;break;
|
||||||
|
#ifdef PCRE2_EXTRA_CASELESS_RESTRICT
|
||||||
case 'r': eoptions |= PCRE2_EXTRA_CASELESS_RESTRICT; break;
|
case 'r': eoptions |= PCRE2_EXTRA_CASELESS_RESTRICT; break;
|
||||||
|
#endif
|
||||||
case 'S': /* Pass. */ break;
|
case 'S': /* Pass. */ break;
|
||||||
case 'X': /* Pass. */ break;
|
case 'X': /* Pass. */ break;
|
||||||
case 'U': coptions |= PCRE2_UNGREEDY; break;
|
case 'U': coptions |= PCRE2_UNGREEDY; break;
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
testing /r modifier in preg_* functions
|
testing /r modifier in preg_* functions
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (PCRE_VERSION_MAJOR == 10 && PCRE_VERSION_MINOR < 43) {
|
||||||
|
die("skip old pcre version");
|
||||||
|
}
|
||||||
|
?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
echo "SK substitute matching" . PHP_EOL;
|
echo "SK substitute matching" . PHP_EOL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue