ID: 36437 Updated by: [EMAIL PROTECTED] Reported By: shahir_reza2001 at yahoo dot com -Status: Open +Status: Feedback Bug Type: PHP options/info functions Operating System: FreeBSD 4.11 PHP Version: 5.1.2 New Comment:
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 possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2006-02-18 02:34:55] shahir_reza2001 at yahoo dot com Description: ------------ Preg_replace wont replace properly Reproduce code: --------------- $patterns = '{([\w_]+)(\s*</font>)'. 3 '(\s*<font\s+color="'.$keycol.'">\s*\()}m'; 4 $replacements = '<a class="code" title="View manual page for $1" href="'.$manual.'$1" target="_blank">$1</a>$2$3'; 5 return preg_replace($patterns, $replacements, $code); example using php4+: downlaod any file from http://www.codedb.org/files.php?lang=php and it will underline the add <a href> to the php functions Expected result: ---------------- <br /></font><font color="#007700">function </font><font color="#0000BB"><a class="code" href="http://www.php.net/manual-lookup.php?lang=en&pattern=isemail" title="View manual page for isemail" target="_blank">isemail</a></font><font color="#007700">(</font><font color="#0000BB">$mail</font><font color="#007700">) <br />{ <br /> if (</font><font color="#0000BB"><a class="code" href="http://www.php.net/manual-lookup.php?lang=en&pattern=eregi" title="View manual page for eregi" target="_blank">eregi</a></font><font color="#007700">(</font><font color="#DD0000">"[EMAIL PROTECTED],4}$"</font><font color="#007700">,</font><font color="#0000BB">$mail</font><font color="#007700">)) <br /> { <br /> return </font><font color="#0000BB">1</font><font color="#007700">; <br /> } <br /> else { <br /> return </font><font color="#0000BB">0</font><font color="#007700">; <br /> } <br />} <br /></font><font color="#0000BB">?></font> Actual result: -------------- <br /></span><span style="color: #007700">function </span><span style="color: #0000BB">isemail</span><span style="color: #007700">(</span><span style="color: #0000BB">$mail</span><span style="color: #007700">) <br />{ <br /> if (</span><span style="color: #0000BB">eregi</span><span style="color: #007700">(</span><span style="color: #DD0000">"[EMAIL PROTECTED],4}$"</span><span style="color: #007700">,</span><span style="color: #0000BB">$mail</span><span style="color: #007700">)) <br /> { <br /> return </span><span style="color: #0000BB">1</span><span style="color: #007700">; <br /> } <br /> else { <br /> return </span><span style="color: #0000BB">0</span><span style="color: #007700">; <br /> } <br />} <br /></span><span style="color: #0000BB">?></span> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36437&edit=1