Can anyone help me sort why single and double quotes are getting stripped out when, for example, Content: Title is used for the file's display name? It seems to be an issue with the views field formatter since the standard unformatted list, table, etc. formatters display the titles properly.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | jplayer-views-playlist-htmlspecialchars-1880632-5.patch | 1.27 KB | xamanu |
| #1 | www.shiftindependent.com 2013-1-4 17:11:11.png | 8.3 KB | sondes |
Comments
Comment #1
sondes commentedHere's a screenshot to clarify.
Comment #2
sondes commentedI ended up going with a really simple solution to render HTML characters properly.
On line 116 of jplayer_style_plugin.inc I added:
$label = htmlspecialchars_decode($label, ENT_QUOTES);The playlist seems to be working just as it was. Is this something that someone could add to .dev?
Comment #3
dawehnerThe problem here is that views already escapes it's values, so the additional check plain might causes problems.
One possible solution could be to let code which provides the label take care about the escaping, so maybe let jplayer_sort_files() escape all
item labels unless the ones coming from an external source and then drop the check_plain() out of the template?
Comment #4
ghosts commentedThis is not the most elegant way to fix it, but in the file
jplayer_style_plugin.incI added the following at line 120:It works. Of course, only for apostrophes (which is all I wanted) but you could tinker with it.
Since I didn't include a patch, here is the surrounding code so that you can navigate yourself:
Comment #5
xamanu commentedHere is a patch. I just decode htmlspecialchars in the jplayer_sort_files() function, works for me and should be fine.
Comment #6
jerry commentedThe patch above is working for me, though I needed to specify ENT_QUOTES rather than the default ENT_COMPAT to htmlspecialchars_decode().