Download & Extend

Special HTML Characters in alt tag

Project:Smileys
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

The current version of the module places special HTML characters in the alt tag of the images. Besides the fact that I find that the code for a smiley should be in the title tag and the description in the alt tag (usability), these characters cause the page to be invalid HTML. I suggest using htmlspecialchars() in PHP to fill the alt tags with the right code and use some JS like this to turn it back into the actual code:

var smiley = ' ' + this.alt.replace(new Array('$amp;', '&quot;', '&#039;', '&lt;', '&gt;'), new Array('&','"','\'','<','>')) + ' ';

(replacement code for line 30 in smileys.js)

I'm just starting to learn a bit more about JS, so I hope this code is efficient enough.

Comments

#1

Status:active» closed (won't fix)

#2

Status:closed (won't fix)» postponed (maintainer needs more info)

It's not very polite to mark something as a won't fix without even giving an explanation.

#3

< and > are already handled when adding new packs. I am not sure if the other characters you report would make the page HTML invalid. Will need to investigate in this.

nobody click here