Slider text labels breaking on punctuation.

cr0nky - March 6, 2009 - 20:40
Project:Slider
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Mark Theunissen
Status:needs review
Description

Node titles within the slider may have punctuation such as an apostrophe in contractions (can't, won't, shouldn't, etc). The apostrophe is rendering as the entity declaration (') instead of as an apostrophe.

#1

Mark Theunissen - March 16, 2009 - 18:19
Assigned to:Anonymous» Mark Theunissen

Thanks, will look into it when I get a chance!

#2

Matt Bergel - November 15, 2009 - 08:46
Status:active» needs review

Hi,

This is a double escaping issue. In template_preprocess_slider(), the tabs title are escaped once through check_plain(), and a second time through l() (which uses check_plain in the backend).

There are two options:
- Removing the first call to check_plain()
- Tell l() that the text is already escaped (by adding 'html' => TRUE to the array of options - $slide_options)

Both have been tested and work equally fine.

However, since the tabs title are only ever used once (to create the tabs), it made more sense to me to go with the first option and let l() do the escaping work for us.

Matt

AttachmentSize
slider-393460-2.patch 482 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.