#21645 [Bgs->Csd]: eregi_replace seems not to work correctly
| From: | thelucas at directbox dot com | Date: | Wed, 15 Jan 2003 11:23:29 +0000 |
| Subject: | #21645 [Bgs->Csd]: eregi_replace seems not to work correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30096@lists.php.net to get a copy of this message | ||
ID: 21645
User updated by: thelucas@directbox.com
Reported By: thelucas@directbox.com
-Status: Bogus
+Status: Closed
Bug Type: *Regular Expressions
Operating System: 2.4.17-rc2aa2-2g
PHP Version: 4.2.0
New Comment:
Thank you, the update to the latest version seem to fix this issue.
Best Regards,
Lucas
Previous Comments:
------------------------------------------------------------------------
[2003-01-15 03:32:52] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
------------------------------------------------------------------------
[2003-01-14 21:34:41] thelucas@directbox.com
Hello,
eregi_replace does not seem to work correctly for me (php/4.2.0)
template.inc:
...
...
var $_tpl_vars= array();
var $tpl;
...
...
function render()
{
foreach ($this->_tpl_vars as $key => $val)
{
echo "$key - $t\n";
$rend_tpl =
eregi_replace("&&".$key."&&",$this->_tpl_vars[$key],$this->tpl);
$a=$this->_tpl_vars[$key];
}
return $rend_tpl;
}
test.php:
<?
require ("templates.inc");
$test = new template;
$test->init("entry.tpl");
$test->set("size",300);
$test->set("title",280);
$test->set("url","sdfdf2");
$test->set("match","sdfs2d");
echo $test->render();
?>
this produces the following output:
size - 300
title - 280
url - sdfdf2
match - sdfs2d
sdfs2d &&size&& &&url&& sdfs2d &&title&&
bash-2.05$
Obviously the parameter passing works, because the function returns the
$key and the value too. As you see only the URL IS SUBSITUTED. I think
this could be a bug.
entry.tpl looks like this:
bash-2.05$ cat entry.tpl
&&match&& &&size&& &&url&& &&match&&
&&title&&
bash-2.05$
Thank you for your response,
Lucas
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21645&edit=1