Closed (fixed)
Project:
Read More Link (Drupal 6 and earlier)
Version:
6.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Jun 2010 at 05:52 UTC
Updated:
23 Dec 2010 at 02:40 UTC
If nothing is entered to override the link title, then no tokens are replaced for the link text.
The else clause in function ed_readmore_link_render($node, $display, $anchor) incorrectly includes the line to replace tokens for the link text:
if (empty($link_title)) {
$link_title = t('Read the rest of !title.', array('!title' => $node->title));
}
// Replace tokens with values if the Token module and the token options are enabled.
else if (module_exists('token') && variable_get('ed_readmore_tokens', TRUE)) {
$link_text = token_replace($link_text, 'node', $node); // <== this line shouldn't be here (aenw)
$link_title = token_replace($link_title, 'node', $node);
}
The line that replaces the tokens for $link_text should be moved up before the conditional test for (empty($link_title)). I don't know if the token_replace() call should go before the xss testing and code or after. And I don't have experience rolling a patch yet, else I'd do that.
(And this module is just the thing I need to make sure that the site I'm working on is as accessible as possible. Thanks!)
Comments
Comment #1
todd nienkerk commentedGood catch! I've changed the "else if" to a second "if" conditional, which should avoid this issue.
I will commit a fix shortly.