Skip to content

Commit 11927ca

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: fix for pcre2 10.38 fix for pcre2 10.38
2 parents ee87de6 + 17aae13 commit 11927ca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/pcre/php_pcre.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ static void php_pcre_efree(void *block, void *data)
193193
efree(block);
194194
}
195195

196+
#ifdef PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
197+
/* pcre 10.38 needs PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK, disabled by default */
198+
#define PHP_PCRE_DEFAULT_EXTRA_COPTIONS PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
199+
#else
200+
#define PHP_PCRE_DEFAULT_EXTRA_COPTIONS 0
201+
#endif
202+
196203
#define PHP_PCRE_PREALLOC_MDATA_SIZE 32
197204

198205
static void php_pcre_init_pcre2(uint8_t jit)
@@ -213,6 +220,8 @@ static void php_pcre_init_pcre2(uint8_t jit)
213220
}
214221
}
215222

223+
pcre2_set_compile_extra_options(cctx, PHP_PCRE_DEFAULT_EXTRA_COPTIONS);
224+
216225
if (!mctx) {
217226
mctx = pcre2_match_context_create(gctx);
218227
if (!mctx) {

0 commit comments

Comments
 (0)