Closed (won't fix)
Project:
Advertisement
Version:
6.x-2.2
Component:
ad module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2010 at 21:03 UTC
Updated:
23 Mar 2011 at 00:16 UTC
When using apostrophes in the mouseover text they appear incorrectly. The apostrophes are replaced by '
For example, "Kim's Upholstery" shows up as Kim's Upholstery.
I have looked in the database and the record is entered correctly, this is purely a display issue with the module.
Any thoughts? Please see attached screenshot for example.
| Comment | File | Size | Author |
|---|---|---|---|
| screenshot-apostrophe.jpg | 78.06 KB | jbergeron |
Comments
Comment #1
ethnovode commentedHello, I have this problem too. I removed the checkplain() function around the tooltip and alt everywhere (in image.module) and now it seems to work. My site didn't explode yet.
It's probably not the best way to solve this problem.
http://api.drupal.org/api/function/check_plain/6
Comment #2
sleepingmonkcheck_plain uses the flag ENT_QUOTES in it's call to htmlspecialchars which is converting the single quote.
The encoding can't be converted back to a single quote in the title attribute. Perhaps replacing check_plain($tooltip) with htmlspecialchars($tooltip, ENT_COMPAT, 'UTF-8'); is an acceptable alternative? Then at least we're still filtering the output.
Can the title attribute actually execute html code anyway? Perhaps the filtering is not necessary. I'm happy to make a patch if the maintainers think either htmlspecialchars or simply removing the check is acceptable.
Comment #3
john franklin commentedSome conversion must be done. If the tool text passed contains a double quote, that would close the tag prematurely and leave the module open to XSS or other page hijacking. However, when I checked with several different browsers (Safari, Chrome, OmniWeb and Firefox (both 3.6 and the new 4.0)), no decoding of any HTML entities was performed by any of them. >, <, " and ' were all shown as HTML entities > < " and ' respectively.
I'm going to mark this "won't fix" because:
1. Calling
insert some JavaScript herecheck_plain()is consistent with other Drupal modules (e.g, imagecache, lightbox2 and imagefield)2. A proper encoding should remove HTML tags intelligently
* The tool tip "Show some emphasis!" should become "Show some emphasis!"
* The tool tip "
" should be blank.
3. Such a function should be a Drupal core function peered with
check_plain()If you open a bug with the core, note it here and I'll support your efforts with the core team.