Commit 2a881d81 authored by Dries's avatar Dries
Browse files

- Patch #1185842 by Dave Reid: the [node:author] token does not use format_username().

parent aafb25c2
......@@ -2261,6 +2261,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
$tests['[node:language]'] = check_plain($node->language);
$tests['[node:url]'] = url('node/' . $node->nid, $url_options);
$tests['[node:edit-url]'] = url('node/' . $node->nid . '/edit', $url_options);
$tests['[node:author]'] = check_plain(format_username($account));
$tests['[node:author:uid]'] = $node->uid;
$tests['[node:author:name]'] = check_plain(format_username($account));
$tests['[node:created:since]'] = format_interval(REQUEST_TIME - $node->created, 2, $language->language);
......
......@@ -157,8 +157,9 @@ function node_tokens($type, $tokens, array $data = array(), array $options = arr
// Default values for the chained tokens handled below.
case 'author':
$name = ($node->uid == 0) ? variable_get('anonymous', t('Anonymous')) : $node->name;
$replacements[$original] = $sanitize ? filter_xss($name) : $name;
$account = user_load($node->uid);
$name = format_username($account);
$replacements[$original] = $sanitize ? check_plain($name) : $name;
break;
case 'created':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment