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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: analogue at glop dot org
New email:
PHP Version: OS:

 

 [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 18 06:01:28 2024 UTC