For pure code consistency, all tokens that also have a -raw token should be handled like this:

  $tokens['sometoken-raw'] = $somedata;
  $tokens['sometoken'] = check_plain($tokens['sometoken-raw']);

Many tokens handle it like this:

  $tokens['sometoken-raw'] = $somedata;
  $tokens['sometoken'] = check_plain($somedata);

While obviously a minuscule issue, consistency would be worthwhile.

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new8.66 KB

A few of them weren't appropriate, e.g. 'bookpath', but this patch will resolve the ones that make sense.

dave reid’s picture

Status: Needs review » Needs work
+++ token_comment.inc	30 Oct 2010 21:54:33 -0000
@@ -26,16 +26,14 @@ function comment_token_values($type, $ob
-      $values['comment-body']            = check_markup($comment->comment, $comment->format, FALSE);
-      $values['comment-author-name']     = check_plain($comment->name);
-      $values['comment-author-uid']      = $comment->uid;
-      $values['comment-author-homepage'] = check_url($comment->homepage);
-
-      // Raw counterparts of user supplied data.
       $values['comment-title-raw']       = $comment->subject;
+      $values['comment-title']           = check_plain($values['comment-title-raw']);
       $values['comment-body-raw']        = $comment->comment;

Lost parameters to check_markup() here.

Powered by Dreditor.

dave reid’s picture

Hrm, I'm not necessarily sold on why this is necessary? If we've already got the raw variable, does this just improve readability?

damienmckenna’s picture

It's completely superfluous and purely for readability. It also helps ensure things like #957934: Are current-page-path and current-page-path-raw backwards? doesn't happen ;-)

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new8.68 KB

Restored the missing check_markup() arguments.

Status: Needs review » Needs work

The last submitted patch, token-n957940-5.patch, failed testing.

bluegeek9’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)