PHP 4.0 Bug #3850: ereg_replace broken when pattern string is too long
| From: | brian at phorum dot org | Date: | Thu, 16 Mar 2000 21:24:30 +0000 |
| Subject: | PHP 4.0 Bug #3850: ereg_replace broken when pattern string is too long | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16910@lists.php.net to get a copy of this message | ||
From: brian@phorum.org
Operating system: Solaris and Windows
PHP version: 4.0 Beta 2
PHP Bug Type: Misbehaving function
Bug description: ereg_replace broken when pattern string is too long
This script:
------------------------------
$body='<table>';
$body=ereg_replace("<(/*[b|u|i|font|ol|ul|li|img|a] *[^>]*)>", "[\\1]",
$body);
echo $body;
produces:
------------------------------
[table]
That is wrong.
Shorten the pattern:
------------------------------
$body='<table>';
$body=ereg_replace("<(/*[b|u|i] *[^>]*)>", "[\\1]", $body);
echo $body;
That produces:
------------------------------
<table>
AS it should. This appears to be a problem in 3.x as well.