php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50835 Unexpected PREG_BACKTRACK_LIMIT_ERROR
Submitted: 2010-01-25 15:54 UTC Modified: 2010-01-25 15:58 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: analogue at glop dot org Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.12 OS: Debian GNU/Linux
Private report: No CVE-ID: None
 [2010-01-25 15:54 UTC] analogue at glop dot org
Description:
------------
Hi,

When I try to preg_replace a 2654 long string, I get a PREG_BACKTRACK_LIMIT_ERROR

It's strange because as shown, the PHP pcre.backtrack_limit is set as the default 100000 limit.

Why does it hits the limit with a short string like this ?

Thanks

Reproduce code:
---------------
<http://pastebin.com/fa42d78d>

Expected result:
----------------
100000
2653
2653


Actual result:
--------------
100000
2653
Error: PREG_BACKTRACK_LIMIT_ERROR


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-25 15:58 UTC] jani@php.net
Ask PCRE developers.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC