summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-06-29 00:57:19 +0000
committerDries Buytaert <dries@buytaert.net>2010-06-29 00:57:19 +0000
commitb6c0d1ab208af3cd16316324f54d2e10875b5286 (patch)
treef569d6bf46c680a867e5c838b91be00659a32265 /modules/comment
parentcbfdd2e9c7bc67f374ecb434369111d630399fea (diff)
downloadbrdo-b6c0d1ab208af3cd16316324f54d2e10875b5286.tar.gz
brdo-b6c0d1ab208af3cd16316324f54d2e10875b5286.tar.bz2
- Patch #831914 by Dave Reid: removed redundant/duplicate [node:uid], [comment:uid], and [file:uid] tokens.
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.test6
-rw-r--r--modules/comment/comment.tokens.inc24
2 files changed, 3 insertions, 27 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 03cc74ba7..ae680cecd 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -1187,9 +1187,6 @@ class CommentTokenReplaceTestCase extends CommentHelperCase {
// Generate and test sanitized tokens.
$tests = array();
$tests['[comment:cid]'] = $comment->cid;
- $tests['[comment:pid]'] = $comment->pid;
- $tests['[comment:nid]'] = $comment->nid;
- $tests['[comment:uid]'] = $comment->uid;
$tests['[comment:hostname]'] = check_plain($comment->hostname);
$tests['[comment:name]'] = filter_xss($comment->name);
$tests['[comment:mail]'] = check_plain($this->admin_user->mail);
@@ -1200,8 +1197,11 @@ class CommentTokenReplaceTestCase extends CommentHelperCase {
$tests['[comment:edit-url]'] = url('comment/' . $comment->cid . '/edit', $url_options);
$tests['[comment:created:since]'] = format_interval(REQUEST_TIME - $comment->created, 2, $language->language);
$tests['[comment:changed:since]'] = format_interval(REQUEST_TIME - $comment->changed, 2, $language->language);
+ $tests['[comment:parent:cid]'] = $comment->pid;
$tests['[comment:parent:title]'] = check_plain($parent_comment->subject);
+ $tests['[comment:node:nid]'] = $comment->nid;
$tests['[comment:node:title]'] = check_plain($node->title);
+ $tests['[comment:author:uid]'] = $comment->uid;
$tests['[comment:author:name]'] = check_plain($this->admin_user->name);
// Test to make sure that we generated something for each token.
diff --git a/modules/comment/comment.tokens.inc b/modules/comment/comment.tokens.inc
index cf26d74c9..3f233733d 100644
--- a/modules/comment/comment.tokens.inc
+++ b/modules/comment/comment.tokens.inc
@@ -31,18 +31,6 @@ function comment_token_info() {
'name' => t("Comment ID"),
'description' => t("The unique ID of the comment."),
);
- $comment['pid'] = array(
- 'name' => t("Parent ID"),
- 'description' => t("The unique ID of the comment's parent, if comment threading is active."),
- );
- $comment['nid'] = array(
- 'name' => t("Node ID"),
- 'description' => t("The unique ID of the node the comment was posted to."),
- );
- $comment['uid'] = array(
- 'name' => t("User ID"),
- 'description' => t("The unique ID of the user who posted the comment."),
- );
$comment['hostname'] = array(
'name' => t("IP Address"),
'description' => t("The IP address of the computer the comment was posted from."),
@@ -138,18 +126,6 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
$replacements[$original] = $comment->cid;
break;
- case 'pid':
- $replacements[$original] = $comment->pid;
- break;
-
- case 'nid':
- $replacements[$original] = $comment->nid;
- break;
-
- case 'uid':
- $replacements[$original] = $comment->uid;
- break;
-
// Poster identity information for comments
case 'hostname':
$replacements[$original] = $sanitize ? check_plain($comment->hostname) : $comment->hostname;