php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45446 some bugs in preg_match_all
Submitted: 2008-07-07 13:02 UTC Modified: 2008-07-07 13:16 UTC
From: killthem at empal dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.6 OS: FreeBSD4.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: killthem at empal dot com
New email:
PHP Version: OS:

 

 [2008-07-07 13:02 UTC] 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 );
?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-07 13:16 UTC] felipe@php.net
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 06:00:02 2025 UTC