ID: 39005
User updated by: php at edwardk dot info
Reported By: php at edwardk dot info
Status: Open
Bug Type: mbstring related
Operating System: Windows 2003
PHP Version: 5.2.1
New Comment:
Further testing shows that ereg_replace throws an error on the
particular regex while mb_ereg_replace does not.
Previous Comments:
------------------------------------------------------------------------
[2007-02-21 12:16:56] php at edwardk dot info
I have since upgraded to PHP 5.2.1.
I've isolated this bug to a specific function, an example script is
shown here:
<?php
$test = 'afds [EMAIL PROTECTED] sfda';
echo $test.'<br>';
$test = mb_ereg_replace('\#([^,]+?)\@(irc(\.[\w\-]+)+)','<a class="irc"
href="irc://\2/\1">[EMAIL PROTECTED]</a>', $test);
echo $test;
?>
the intended use for this code segment is to replace irc links in text
with clickable ones, eg, "[EMAIL PROTECTED]" becomes "<a
href="irc://irc.freenode.net/blah">[EMAIL PROTECTED]</a>
Crashes can be reproduced with ab (ApacheBench) with the following
command line:
ab -n 1000 -c 50 http://url/
Crashes occur faster when concurrency is higher, at -c 2 or so crashes
don't happen.
Workaround:
Replacing mb_ereg_replace with ereg_replace stops the crashing from
occuring, but with loss of multibyte support.
------------------------------------------------------------------------
[2006-10-12 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-10-04 09:05:04] [EMAIL PROTECTED]
Unfortunatelly we are not able to generate debug pack for PHP4. You
would have to come up with reproducing script the old fashioned, trial
and error way :)
------------------------------------------------------------------------
[2006-10-04 06:52:38] php at edwardk dot info
Can a PHP 4.4.4 Win32 debug pack be created? I'm having a very
difficult time isolating the script for this problem.
------------------------------------------------------------------------
[2006-10-02 09:10:52] [EMAIL PROTECTED]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/39005
--
Edit this bug report at http://bugs.php.net/?id=39005&edit=1