From 7f61db0e3a5547883e1f7c13eaba0abbac904a1c Mon Sep 17 00:00:00 2001
From: Shawn DeArmond <code@dearmond.net>
Date: Sun, 20 Mar 2011 23:15:46 -0700
Subject: [PATCH] #1099768 by Shawn DeArmond: Fixed ['destination'] may not be set in flag_friend_message_form().

---
 flag_friend.module |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/flag_friend.module b/flag_friend.module
index d9226b1..e879290 100644
--- a/flag_friend.module
+++ b/flag_friend.module
@@ -372,10 +372,11 @@ function flag_friend_message_form($action, $flag, $content_id, $token) {
     '#cols' => 60,
     '#rows' => 5,
   );
+  $cancel = array_key_exists('destination', $_GET) ? $_GET['destination'] : 'user/' . $content_id;
   $form['flag_friend_submit'] = array(
     '#type' => 'submit',
     '#value' => t('Send'),
-    '#suffix' => l(t('Cancel'), $_GET['destination']),
+    '#suffix' => l(t('Cancel'), $cancel),
   );
   $form['#theme'] = 'flag_friend_message_form';
   return $form;
-- 
1.7.0.3

