From 52c0c18cad2ef3c67a9782c60af4017429299b2a Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sun, 29 Jan 2006 08:01:55 +0000
Subject: [PATCH] - Patch #46622 by Neil: more forgiving hook_user('view').

---
 modules/user.module      | 9 +++++++--
 modules/user/user.module | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/modules/user.module b/modules/user.module
index 190e3abf5db6..81723ce9ac1b 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -628,10 +628,15 @@ function theme_user_profile($account, $fields) {
   $output = "<div class=\"profile\">\n";
   $output .= theme('user_picture', $account);
   foreach ($fields as $category => $items) {
-    $output .= "<h2 class=\"title\">$category</h2>\n";
+    if (strlen($category) > 0) {
+      $output .= '<h2 class="title">'. $category ."</h2>\n";
+    }
     $output .= '<dl>';
     foreach ($items as $item) {
-      $output .= sprintf('<dt class="%s">%s:</dt><dd class="%s">%s</dd>', $item['class'], $item['title'], $item['class'], $item['value']);
+      if (isset($item['title'])) {
+        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .':</dt>';
+      }
+      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
     }
     $output .= '</dl>';
   }
diff --git a/modules/user/user.module b/modules/user/user.module
index 190e3abf5db6..81723ce9ac1b 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -628,10 +628,15 @@ function theme_user_profile($account, $fields) {
   $output = "<div class=\"profile\">\n";
   $output .= theme('user_picture', $account);
   foreach ($fields as $category => $items) {
-    $output .= "<h2 class=\"title\">$category</h2>\n";
+    if (strlen($category) > 0) {
+      $output .= '<h2 class="title">'. $category ."</h2>\n";
+    }
     $output .= '<dl>';
     foreach ($items as $item) {
-      $output .= sprintf('<dt class="%s">%s:</dt><dd class="%s">%s</dd>', $item['class'], $item['title'], $item['class'], $item['value']);
+      if (isset($item['title'])) {
+        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .':</dt>';
+      }
+      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
     }
     $output .= '</dl>';
   }
-- 
GitLab