PHP 4.0 Bug #6460 Updated: bug in eregi_replace?¿?
| From: | Bug Database | Date: | Thu, 21 Sep 2000 14:27:40 +0000 |
| Subject: | PHP 4.0 Bug #6460 Updated: bug in eregi_replace?¿? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33591@lists.php.net to get a copy of this message | ||
ID: 6460
Updated by: sniper
Reported By: anpe@sensei.org
Status: Closed
Bug Type: Scripting Engine problem
Assigned To:
Comments:
No feedback. And not enough info either.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2000-08-31 08:45:24] stas@php.net
so, what's the problem there? Could you please cut down your code to shortest reproducing
script possible and clearly describe what's the problem? Also, before doing this, please check
4.0.2.
---------------------------------------------------------------------------
[2000-08-31 06:23:20] anpe@sensei.org
This Script is a simple Traduction of some HTML Tags
---------------------------------------------------------------------------
[2000-08-31 06:11:13] anpe@sensei.org
php FILE
<----- BEGIN ------>
<?php
function traduceChar($phrase) {
switch($phrase) {
case "charPreferences": $tmp = "Preferencias"; break;
case "charDoTests": $tmp = "Hacer Tests"; break;
case "charHistory": $tmp = "Historial"; break;
case "charMail": $tmp = "Correo"; break;
case "charHelp": $tmp = "Ayuda"; break;
default: $tmp = "$phrase : Error"; break;
}
return $tmp;
}
function loadPage($htmlArchive) {
if ( file_exists("./$htmlArchive") ) {
$fd = fopen("./$htmlArchive" , "r");
while (!feof($fd)) {
$buffer = fgets($fd, 4096);
if ( eregi( "<#([A-Z]+)>", $buffer ) ) {
echo eregi_replace( "<#([A-Z]+)>", traduceChar("\1") ,$buffer
);
}
else
{
echo $buffer;
}
}
fclose ($fd);
}
else
{
die("Error");
}
}loadPage("menu.html");
?>
<----- END ------>
Next menu.html
<----- BEGIN ------>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<link rel='stylesheet' type='text/css' href='style.css'>
<body bgcolor='#FFFFFF' topmargin='0' leftmargin='0'
marginheight='0' marginwidth='0' text='#000000'
link='#FF66CC' alink='#FF99FF' vlink='#FF66CC'>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH=100%>
<TR><TD ALIGN=LEFT><IMG SRC="icons/logo.jpg"></TD></TR>
<TR HEIGHT="1"><TD HEIGHT="1" BGCOLOR="#000000"><IMG
SRC="icons/nullb.gif" HEIGHT="1" WIDTH="1"></TD></TR>
</TABLE><TABLE BORDER="0" ALIGN=CENTER CELLSPACING="0"
CELLPADDING="3" BGCOLOR="FFFFDD" WIDTH=100%>
<TR ALIGN=CENTER>
<TD><A HREF="<#hrefPreferences>"><IMG SRC="icons/admin.gif"
BORDER="0"></A></TD>
<TD><A HREF="<#hrefTests>"><IMG SRC="icons/test.gif"
BORDER="0"></A></TD>
<TD><A HREF="<#hrefHistory>"><IMG SRC="icons/grafico.gif"
BORDER="0"></A></TD>
<TD><A HREF="<#hrefMail>"><IMG SRC="icons/mailbox.gif"
BORDER="0"></A></TD>
<TD><A HREF="<#hrefHelp>"><IMG SRC="icons/admiracion.gif"
BORDER="0"></A></TD>
</TR>
<TR ALIGN=CENTER>
<TD><A
HREF="<#hrefPreferences>"><#charPreferences></A></TD>
<TD><A HREF="<#hrefTests>"><#charDoTests></A></TD>
<TD><A HREF="<#hrefHistory>"><#charHistory></A></TD>
<TD><A HREF="<#hrefMail>"><#charMail></A></TD>
<TD><A HREF="<#hrefHelp>"><#charHelp></A></TD>
</TR>
</TABLE><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"
WIDTH=100%>
<TR HEIGHT="1" ><TD HEIGHT="1" BGCOLOR="#000000"><IMG
SRC="icons/nullb.gif" HEIGHT="1" WIDTH="1"></TD></TR>
</TABLE>
</BODY>
</HTML>
<----- END ------>
Modules Compiled --> Mysql
No php.ini modified
Standar Setup like the INSTALL file
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6460