summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorunknown2013-07-23 20:11:17 (GMT)
committer unknown2013-07-23 20:11:17 (GMT)
commit2319170eeb623e3e03a1e535875714979d75df72 (patch)
tree4ea6764c70caebed7d575ab7a0b02195ede11935
parent7d6a3339b05fb39dd9f3246a4e53cde53b47d24e (diff)
Issue #2034387 by David_Rothstein: Fix Link text of embedded documents is double encoded.
-rw-r--r--includes/media.filter.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/media.filter.inc b/includes/media.filter.inc
index b3263a1..a17d7eb 100644
--- a/includes/media.filter.inc
+++ b/includes/media.filter.inc
@@ -355,7 +355,10 @@ function media_token_to_markup($match, $wysiwyg = FALSE) {
// desired text will be used (see, for example, theme_file_link()).
// @todo: Try to find a less hacky way to do this.
if (isset($tag_info['link_text'])) {
- $file->filename = $tag_info['link_text'];
+ // The link text will have characters such as "&" encoded for HTML, but the
+ // filename itself needs the raw value when it is used to build the link,
+ // in order to avoid double encoding.
+ $file->filename = htmlspecialchars_decode($tag_info['link_text'], ENT_NOQUOTES);
}
if ($wysiwyg) {