From: spam at dragy dot de
Operating system: Any
PHP version: 5.2.0
PHP Bug Type: PCRE related
Bug description: regular expression breaking on strings >= 24999 characters
Description:
------------
The following preg_replace breaks when the string is => 24999 characters.
Works perfectly fine with 24998 characters and worked fine with any
strings in PHP 5.1.5.
Reproduce code:
---------------
<?php
$string = str_repeat('a', 100000);
echo
preg_replace('#(^.*|.*)(\[(php|html|noparse)\].*\[/\\3])(.*|.*$)#siUe',
'', $string);
?>
Expected result:
----------------
100.000 times 'a'
Actual result:
--------------
nothing
--
Edit bug report at http://bugs.php.net/?id=39405&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39405&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39405&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39405&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39405&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39405&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39405&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39405&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39405&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39405&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39405&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39405&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39405&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39405&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39405&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39405&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39405&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39405&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39405&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39405&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39405&r=mysqlcfg