Menu

#3 &quot symbol management

open
nobody
None
5
2005-11-20
2005-11-20
Vitaly
No

When using wapreader with courier-imap, sometimes if i have &quot symbol message text wapreader creates incorrect wml:

<p>
from:&amp;quot;user&amp;quot; &lt;user@rambler.ru&gt; <br/>
subj: <br/>
<a href="/wapreader/wapreader.php?action=view&amp;msg=1561&amp;sid=fb26caa7475b47c4959ba82093154c12">[view &gt;&gt;&gt;]</a><br/>
<br/>
</p>

Small bug is in function wmlspecialchars, that replace '&' symbol with &amp.
I attach patch for it:

--- ./wapreader.php Sun Nov 20 19:30:51 2005
+++ ./wapreader.php Sun Nov 20 20:10:30 2005
@@ -621,6 +621,7 @@
function wmlspecialchars($text)
{
$text=str_replace( array("\"","'","&","<",">","$"), array("&quot;","&apos;","&amp;","&lt;","&gt;","$$"), $text);
+ $text=str_replace( array("&amp;quot;"), array("&quot;"), $text);
return $text;
}

Have a fun :D

Discussion


Log in to post a comment.