|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patch Bug_52732_preg_match_false_on_error for PCRE related Bug #52732Patch version 2010-10-07 13:37 UTC Return to Bug #52732 | Download this patchThis patch is obsolete Obsoleted by patches: Patch Revisions:Developer: slugonamission@gmail.com
Index: ext/pcre/php_pcre.c
===================================================================
--- ext/pcre/php_pcre.c (revision 304164)
+++ ext/pcre/php_pcre.c (working copy)
@@ -754,7 +754,13 @@
efree(offsets);
efree(subpat_names);
- RETVAL_LONG(matched);
+ /* Did we encounter an error? */
+ if(PCRE_G(error_code) == PHP_PCRE_NO_ERROR) {
+ RETVAL_LONG(matched);
+ }
+ else {
+ RETVAL_FALSE;
+ }
}
/* }}} */
Index: ext/pcre/tests/backtrack_limit.phpt
===================================================================
--- ext/pcre/tests/backtrack_limit.phpt (revision 304164)
+++ ext/pcre/tests/backtrack_limit.phpt (working copy)
@@ -19,7 +19,7 @@
?>
--EXPECT--
-int(0)
+bool(false)
bool(true)
int(10)
bool(true)
Index: ext/pcre/tests/invalid_utf8_offset.phpt
===================================================================
--- ext/pcre/tests/invalid_utf8_offset.phpt (revision 304164)
+++ ext/pcre/tests/invalid_utf8_offset.phpt (working copy)
@@ -22,7 +22,7 @@
echo "Done\n";
?>
--EXPECT--
-int(0)
+bool(false)
array(0) {
}
bool(true)
Index: ext/pcre/tests/recursion_limit.phpt
===================================================================
--- ext/pcre/tests/recursion_limit.phpt (revision 304164)
+++ ext/pcre/tests/recursion_limit.phpt (working copy)
@@ -19,7 +19,7 @@
?>
--EXPECT--
-int(0)
+bool(false)
bool(true)
int(1)
bool(true)
|
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 14:00:02 2025 UTC |