Index: forward.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/forward/forward.module,v
retrieving revision 1.71
diff -u -p -r1.71 forward.module
--- forward.module	19 Dec 2008 20:28:21 -0000	1.71
+++ forward.module	22 Dec 2008 13:32:56 -0000
@@ -38,7 +38,7 @@ function forward_menu() {
     'page callback'    => 'drupal_get_form',
     'page arguments'   => array('forward_form'),
     'access arguments' => array('access epostcard'),
-    'type'             => MENU_NORMAL_ITEM
+    'type'             => MENU_CALLBACK
   );
   $items['admin/reports/forward'] = array(
     'description'      => 'Track forwarded posts',
@@ -338,6 +338,10 @@ function forward_tracker() {
 function forward_page() {
   //print '<pre>'.print_r(menu_get_menu(),1).'</pre>'; exit;
   $nid = NULL;
+  
+  if (empty($_GET['path']) || ($_GET['path'] == 'node/0')) {
+    return 'No path was selected to forward';
+  }
 
   if (!empty($_GET['path'])) {
     $path = drupal_get_normal_path($_GET['path']);
@@ -346,6 +350,7 @@ function forward_page() {
       $nid = $matches[1];
     }
   }
+  //dsm($nid);
   if (is_numeric($nid)) {
     // we have a node
     $node = node_load(array('nid' => $nid));
@@ -355,7 +360,7 @@ function forward_page() {
     }
     $path = 'node/'. $node->nid;
   }
-  else {
+  else if (!empty($path)) {
     $args = explode('/', $path);
     if ($args[0] == 'admin') {
       return drupal_access_denied();
@@ -624,12 +629,13 @@ function forward_form_submit($form, &$fo
       $content->body = '';
     }
   }
+
   $vars = array(
     'forward_header_image' => variable_get('forward_header_image', ''),
     'site_name' => variable_get('site_name', 'Drupal'),
     'yemail' => $form_state['values']['yemail'],
     'forward_message' => t(variable_get('forward_'. $emailtype .'message', '!name thought you would like to see the !site web site.'), array('!name' => l($form_state['values']['yname'], 'mailto:'. $form_state['values']['yemail'], array('absolute' => TRUE)), '!site' => variable_get('site_name', 'drupal'))),
-    'message' => variable_get('forward_filter_html', FALSE) ? nl2br(filter_xss($form_state['values']['message']), implode(',', variable_get('forward_filter_tags', 'p,br,em,strong,cite,code,ul,ol,li,dl,dt,dd'))) : nl2br(check_plain($form_state['values']['message'])),
+    'message' => variable_get('forward_filter_html', FALSE) ? nl2br(filter_xss($form_state['values']['message'], explode(',', variable_get('forward_filter_tags', 'p,br,em,strong,cite,code,ul,ol,li,dl,dt,dd')))) : nl2br(check_plain($form_state['values']['message'])),
     'base_url' => $base_url,
     'content' => $content,
     'path' => $form_state['values']['path'],
@@ -686,6 +692,7 @@ function forward_form_submit($form, &$fo
  * @see _update_message_text()
  */
 function forward_mail($key, &$message, $params) {
+  $message['from'] .= $params['from'];
   $message['subject'] .= $params['subject'];
   $message['body'][] = $params['body'];
   $message['headers']['MIME-Version'] = '1.0';
@@ -697,7 +704,7 @@ function forward_mail($key, &$message, $
  * Implementation of hook_help - adds link to non-node pages
  */
 function forward_help($path) {
-  if (user_access('access forward') && (preg_match("/^node\//i", $path) == 0) && (variable_get('forward_display_nonnode', FALSE))) {
+  if (user_access('access forward') && (preg_match("/^node\//i", $path) == 0) && ($path != 'forward') && (variable_get('forward_display_nonnode', FALSE))) {
     drupal_add_css(drupal_get_path('module', 'forward') .'/forward.css');
     $title = t('Email this page');
     $img = drupal_get_path('module', 'forward') .'/forward.gif';
