Special HTML Characters in alt tag

Xano - July 28, 2007 - 22:47
Project:Smileys
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

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.

#1

stokito - August 25, 2008 - 12:47
Status:active» won't fix

#2

Xano - August 29, 2008 - 15:10
Status: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

Gurpartap Singh - December 3, 2008 - 11:53

< 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.

 
 

Drupal is a registered trademark of Dries Buytaert.