From 8d19973b60d65b4345afdce6c0e48497963aea3e Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 10 Mar 2024 13:01:33 +0100 Subject: [PATCH] Fix external pcre2 build 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. --- ext/pcre/php_pcre.c | 2 ++ ext/pcre/tests/preg_match_caseless_restrict.phpt | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 49526330cff1..f734b91a76b3 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -723,7 +723,9 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, bo /* PCRE specific options */ case 'A': coptions |= PCRE2_ANCHORED; break; case 'D': coptions |= PCRE2_DOLLAR_ENDONLY;break; +#ifdef PCRE2_EXTRA_CASELESS_RESTRICT case 'r': eoptions |= PCRE2_EXTRA_CASELESS_RESTRICT; break; +#endif case 'S': /* Pass. */ break; case 'X': /* Pass. */ break; case 'U': coptions |= PCRE2_UNGREEDY; break; diff --git a/ext/pcre/tests/preg_match_caseless_restrict.phpt b/ext/pcre/tests/preg_match_caseless_restrict.phpt index 8238e286b1cf..3a0d063e8153 100644 --- a/ext/pcre/tests/preg_match_caseless_restrict.phpt +++ b/ext/pcre/tests/preg_match_caseless_restrict.phpt @@ -1,5 +1,11 @@ --TEST-- testing /r modifier in preg_* functions +--SKIPIF-- + --FILE--