cvs: php-src(PHP_5_2) /ext/pcre php_pcre.c /ext/pcre/tests 006.phpt

From: Date: Thu, 20 Sep 2007 08:10:45 +0000
Subject: cvs: php-src(PHP_5_2) /ext/pcre php_pcre.c /ext/pcre/tests 006.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-46232@lists.php.net to get a copy of this message
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]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/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]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]" NULL string(58) "[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]" NULL Done --UEXPECTF-- unicode(58) "[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]" NULL unicode(58) "[CODE]&lt;td align=&quot;$stylevar[right]&quot;&gt;[/CODE]" NULL Done

« previous php.cvs (#46232) next »