diff options
author | Felipe Pena <felipe@php.net> | 2010-11-06 18:32:10 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2010-11-06 18:32:10 +0000 |
commit | 03cbbf4348b7bd95d0322d3371ce1f85efc1e1aa (patch) | |
tree | 056da7aa1674ed063eaf99628c059ac66ed96416 /ext/pcre/php_pcre.c | |
parent | ccfe9c30aaf3a3b0aef164a98295cce68f78e3b3 (diff) | |
download | php-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.c | 8 |
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; + } } /* }}} */ |