@@ -356,6 +356,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
356
356
#endif
357
357
php_error_docref (NULL , E_WARNING ,
358
358
p < ZSTR_VAL (regex ) + ZSTR_LEN (regex ) ? "Null byte in regex" : "Empty regular expression" );
359
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
359
360
return NULL ;
360
361
}
361
362
@@ -369,6 +370,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
369
370
}
370
371
#endif
371
372
php_error_docref (NULL ,E_WARNING , "Delimiter must not be alphanumeric or backslash" );
373
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
372
374
return NULL ;
373
375
}
374
376
@@ -419,6 +421,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
419
421
} else {
420
422
php_error_docref (NULL ,E_WARNING , "No ending matching delimiter '%c' found" , delimiter );
421
423
}
424
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
422
425
return NULL ;
423
426
}
424
427
@@ -467,6 +470,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
467
470
} else {
468
471
php_error_docref (NULL ,E_WARNING , "Null byte in regex" );
469
472
}
473
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
470
474
efree (pattern );
471
475
#if HAVE_SETLOCALE
472
476
if (key != regex ) {
@@ -497,6 +501,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
497
501
}
498
502
#endif
499
503
php_error_docref (NULL ,E_WARNING , "Compilation failed: %s at offset %d" , error , erroffset );
504
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
500
505
efree (pattern );
501
506
if (tables ) {
502
507
pefree ((void * )tables , 1 );
@@ -528,6 +533,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
528
533
}
529
534
if (error != NULL ) {
530
535
php_error_docref (NULL , E_WARNING , "Error while studying pattern" );
536
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
531
537
}
532
538
} else {
533
539
extra = NULL ;
@@ -564,6 +570,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
564
570
}
565
571
#endif
566
572
php_error_docref (NULL , E_WARNING , "Internal pcre_fullinfo() error %d" , rc );
573
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
567
574
return NULL ;
568
575
}
569
576
@@ -575,6 +582,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex)
575
582
}
576
583
#endif
577
584
php_error_docref (NULL , E_WARNING , "Internal pcre_fullinfo() error %d" , rc );
585
+ pcre_handle_exec_error (PCRE_ERROR_INTERNAL );
578
586
return NULL ;
579
587
}
580
588
0 commit comments