tony2001 Thu Sep 20 08:10:45 2007 UTC Added files: (Branch: PHP_5_2) /php-src/ext/pcre/tests 006.phpt
Modified files: /php-src/ext/pcre php_pcre.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.20&r2=1.168.2.9.2.21&diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.20 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.21 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.20 Sat Sep 1 17:51:35 2007 +++ php-src/ext/pcre/php_pcre.c Thu Sep 20 08:10:44 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.20 2007/09/01 17:51:35 nlopess Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.21 2007/09/20 08:10:44 tony2001 Exp $ */ #include "php.h" #include "php_ini.h" @@ -1220,8 +1220,11 @@ efree(subject_value); subject_value = result; subject_len = *result_len; + } else { + efree(subject_value); + return NULL; } - + zend_hash_move_forward(Z_ARRVAL_P(regex)); } http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/006.phpt?view=markup&rev=1.1 Index: php-src/ext/pcre/tests/006.phpt +++ php-src/ext/pcre/tests/006.phpt --TEST-- preg_replace() with array of failing regular expressions --FILE-- <?php $text = '[CODE]<td align="$stylevar[right]">[/CODE]'; $result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU'), '', $text); var_dump($text); var_dump($result); $result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text); var_dump($text); var_dump($result); echo "Done\n"; ?> --EXPECTF-- string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" NULL string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" NULL Done --UEXPECTF-- unicode(58) "[CODE]<td align="$stylevar[right]">[/CODE]" NULL unicode(58) "[CODE]<td align="$stylevar[right]">[/CODE]" NULL Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php