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 | f4927c28bc3b1d7d50a81c9cd1655d003b4a8202 (patch) | |
tree | b56cb35d5f44ab024c5285658c60d4aaec796adc /ext/pcre/php_pcre.c | |
parent | 996f45b688b5d13b81a6bb8e33042a19efd7b130 (diff) | |
download | php-git-f4927c28bc3b1d7d50a81c9cd1655d003b4a8202.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 ccb0a51c0e..ef7e051d86 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; + } } /* }}} */ |