in file_entity.theme.inc, theme_file_entity_download_link has the following comment:

// Peform unsanitized token replacement if $uri['options']['html'] is empty
// since then l() will escape the link text.

However the line that follows does the opposite, indicating that this might be a bug.
$variables['text'] = token_replace($variables['text'], array('file' => $file), array('clear' => TRUE, 'sanitize' => empty($uri['options']['html'])));

We find that because the $uri['options']['html'] appears to be always empty, sanitize is in fact true. This is causing the resulting [file:name] value to be double-escaped.

Steps to reproduce: in a file media entry, create a new file download that has an apostrophe in the name.

Comments

dave reid’s picture

Status: Active » Fixed

Resolved in 7.x-2.x now.

  • Dave Reid committed 72ab07c on 7.x-2.x
    Issue #2339689 by Dave Reid | bob.hinrichs: Fixed download link theme...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.