summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-06 18:32:10 +0000
committerFelipe Pena <felipe@php.net>2010-11-06 18:32:10 +0000
commit03cbbf4348b7bd95d0322d3371ce1f85efc1e1aa (patch)
tree056da7aa1674ed063eaf99628c059ac66ed96416 /ext/pcre/php_pcre.c
parentccfe9c30aaf3a3b0aef164a98295cce68f78e3b3 (diff)
downloadphp-git-03cbbf4348b7bd95d0322d3371ce1f85efc1e1aa.tar.gz
- Fixed bug #52732 (Docs say preg_match() returns FALSE on error, but it returns int(0))
patch by: slugonamission at gmail dot com
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 1bb9e1a80c..0978e8303a 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -754,7 +754,13 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
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;
+ }
}
/* }}} */