? 1
? 300comments.png
? 300nodes.png
? HEAD.png
? _menu_link_translate.png
? comment.patch
? comments.png
? crender2.diff
? damz.png
? head.png
? implode.png
? menu.png
? module_invoke_all.png
? newpatch.png
? nodes.png
? oldpatch.png
? option1.png
? option2.png
? patch.png
? preg_grep.png
? t.png
? t.txt
? t_head.png
? t_patch.png
? template_preprocess.patch
? theme_username.patch
? toolbar.png
? url.patch
? user_access.png
? includes/database/.database.inc.swp
? sites/default/files
? sites/default/settings.php
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.501
diff -u -p -r1.501 theme.inc
--- includes/theme.inc	30 Jul 2009 19:57:09 -0000	1.501
+++ includes/theme.inc	1 Aug 2009 00:54:47 -0000
@@ -1712,6 +1712,11 @@ function theme_more_link($url, $title) {
  *   suggests that this is a site user. Otherwise, only the username is returned.
  */
 function theme_username($object) {
+  static $access_profiles;
+
+  if (!isset($access_profiles)) {
+    $access_profiles = user_access('access user profiles');
+  }
 
   if ($object->uid && $object->name) {
     // Shorten the name when it is too long or it will break many tables.
@@ -1722,7 +1727,7 @@ function theme_username($object) {
       $name = $object->name;
     }
 
-    if (user_access('access user profiles')) {
+    if ($access_profiles) {
       $output = l($name, 'user/' . $object->uid, array('attributes' => array('title' => t('View user profile.'))));
     }
     else {
