Index: modules/search/search.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v
retrieving revision 1.4
diff -u -p -r1.4 search.pages.inc
--- modules/search/search.pages.inc	6 Dec 2007 09:51:01 -0000	1.4
+++ modules/search/search.pages.inc	21 Dec 2007 22:48:32 -0000
@@ -83,23 +83,39 @@ function template_preprocess_search_resu
   $variables['title'] = check_plain($result['title']);
 
   $info = array();
-  if (!empty($result['type'])) {
-    $info['type'] = check_plain($result['type']);
-  }
-  if (!empty($result['user'])) {
-    $info['user'] = $result['user'];
-  }
-  if (!empty($result['date'])) {
-    $info['date'] = format_date($result['date'], 'small');
-  }
-  if (isset($result['extra']) && is_array($result['extra'])) {
-    $info = array_merge($info, $result['extra']);
+  // If the item is a node, only show the post information if allowed by the
+  // theme. For any other type of item, show all the available info.
+  if ($variables['type'] != 'node' || theme_get_setting('toggle_node_info_'. $result['node']->type)) {
+    if (!empty($result['type'])) {
+      $info['type'] = check_plain($result['type']);
+    }
+    if (!empty($result['user'])) {
+      $info['user'] = $result['user'];
+    }
+    if (!empty($result['date'])) {
+      $info['date'] = format_date($result['date'], 'small');
+    }
+    if (isset($result['extra']) && is_array($result['extra'])) {
+      $info = array_merge($info, $result['extra']);
+    }
   }
   // Check for existence. User search does not include snippets.
   $variables['snippet'] = isset($result['snippet']) ? $result['snippet'] : '';
   // Provide separated and grouped meta information..
-  $variables['info_split'] = $info;
   $variables['info'] = implode(' - ', $info);
+
+  // These values must be set, required by search-result.tpl.php.
+  if (!isset($info['type'])) {
+    $info['type']= '';
+  }
+  if (!isset($info['user'])) {
+    $info['user'] = '';
+  }
+  if (!isset($info['date'])) {
+    $info['date']= '';
+  }
+  $variables['info_split'] = $info;
+
   // Provide alternate search result template.
   $variables['template_files'][] = 'search-result-'. $variables['type'];
 }
