From bb5d37ba1337ad3ebf1680a1b2c068ba9fcad956 Mon Sep 17 00:00:00 2001
From: andrew morton <drewish@katherinehouse.com>
Date: Wed, 12 Dec 2012 15:58:32 -0800
Subject: [PATCH] Issue #1304790 by fago and drewish: flagging-user sub-tokens
 not replaced.

---
 includes/flag/flag_flag.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/includes/flag/flag_flag.inc b/includes/flag/flag_flag.inc
index abb2d8a..2844df5 100644
--- a/includes/flag/flag_flag.inc
+++ b/includes/flag/flag_flag.inc
@@ -635,7 +635,7 @@ class flag_flag {
   function flag($action, $entity_id, $account = NULL, $skip_permission_check = FALSE, $flagging = NULL) {
      // Get the user.
     if (!isset($account)) {
-      $account = $GLOBALS['user'];
+      $account = user_load($GLOBALS['user']->uid);
     }
     if (!$account) {
       return FALSE;
-- 
1.7.10.2 (Apple Git-33)

