#45446 [Opn->Bgs]: some bugs in preg_match_all
| From: | felipe@php.net | Date: | Mon, 07 Jul 2008 13:16:44 +0000 |
| Subject: | #45446 [Opn->Bgs]: some bugs in preg_match_all | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-126340@lists.php.net to get a copy of this message | ||
ID: 45446
Updated by: felipe@php.net
Reported By: killthem at empal dot com
-Status: Open
+Status: Bogus
-Bug Type: Regexps related
+Bug Type: PCRE related
Operating System: FreeBSD4.10
PHP Version: 5.2.6
New Comment:
preg_last_error() returns 2, that means PREG_BACKTRACK_LIMIT_ERROR.
See:
http://docs.php.net/manual/en/pcre.configuration.php#ini.pcre.backtrack-limit
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2008-07-07 13:02:21] killthem at empal dot com
Description:
------------
this code doesn't work in php5(5.2.6), but in php4(4.4.8)
Reproduce code:
---------------
<?
$string="<OPAPageResult><OPAretCode>00</OPAretCode><OPAretMessage>SUCCESS</OPAretMessage><OPAvalidfield>oid|price|mid|tid|uid|url|uip|paymethod|goodname|currency|buyername|buyertel|buyeremail|encrypted|sessionkey</OPAvalidfield><OPAjavascriptUrl>http://plugin.inicis.com/pay40_uni.js</OPAjavascriptUrl><OPAjavascript>ClN0YXJ0U21hcnRVcGRhdGUoKTsKZnVuY3Rpb24gZG9TdWJtaXQoKQp7CgkvL2RvY3VtZW50Lm9wYS5hY3Rpb249J09QQXBheS5qc3A111111111111111111111111111111</OPAjavascript></OPAPageResult>";
$match_ele_exp = '/<(\S+)([^>]*)>(.*?)<\/\\1>/s';
preg_match_all($match_ele_exp, $string, $match);
print_r( $match );
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45446&edit=1