From:
Operating system: Debian
PHP version: 5.3.8
Package: mbstring related
Bug Type: Bug
Bug description:mb_ereg leads to script executing timeout
Description:
------------
I tried this with php 5.3.8 and 5.3.2 with the same results.
Test script:
---------------
<?php
$content = '<div class="private-sales-index">
<div class="box">
<div class="content">
<h1>Welcome to our Exclusive Online Store</h1>
<p>If you are a registered member, please <a href="{{store
url="customer/account/login"}}">log in here</a>.</p>
<p class="description">Magento is the leading hub for exclusive specialty
items for all your home, apparel and entertainment needs!</p>
</div>
</div>
</div>';
$content = mbereg_replace("\r\n", ' ', $content);
$content = mbereg_replace("\n", ' ', $content);
var_dump($content);
var_dump(mb_ereg('(.*?\s){100}', $content, $_m));
var_dump($_m);
Expected result:
----------------
$content should be truncated to string that contains ~100 words.
Actual result:
--------------
Script executing hangs.
--
Edit bug report at https://bugs.php.net/bug.php?id=60664&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=60664&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=60664&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=60664&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=60664&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=60664&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=60664&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=60664&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=60664&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=60664&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=60664&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=60664&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=60664&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=60664&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=60664&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=60664&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60664&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=60664&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=60664&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=60664&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=60664&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=60664&r=mysqlcfg