Closed (fixed)
Project:
Drupal core
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Feb 2005 at 15:01 UTC
Updated:
16 Nov 2005 at 18:00 UTC
The node titles printed by node_title_list() are not filtered through drupal_specialchars(), so titles, like bead&breakfast break XHTML validity... The attached patch fixes this.
| Comment | File | Size | Author |
|---|---|---|---|
| Drupal-nodetitle-validity-fix.patch | 839 bytes | gábor hojtsy |
Comments
Comment #1
Steven commentedThis patch ignores the larger problem, which is that node titles and comment titles are run through strip_tags() on /submission/ rather than specialchar'd on display. This makes them inconsistent with all other plain text fields in Drupal. Fixing this requires changing the submission procedure for both and making sure every place where node and comment titles are displayde properly escapes them and not just this once instance.
I've been meaning to fix this, but I just haven't gotten around to it.
Strip_tags() should never, ever be used for content filtering: it prevents you from using any HTML, but you still have to escape & and <.
Comment #2
drummI said I would help out with this is IRC, but I don't think I'll be able to do it.
One question that came up was: Should l() and drupal_get_title() do the filtering for & and <?
Comment #3
gábor hojtsyl() is used to do things like wrapping an image in a link, so escaping < there is definitely not a good idea.
Comment #4
buddaThis problem also affects the menu.module and the links it creates with the title="" attribute. They break xhtml too with the likes of & entity.
Comment #5
flevour commentedIn current CVS titles are handled correctly.
Comment #6
(not verified) commented