Explorar o código

auth/profile.php: fix index warning

Check for $GLOBALS['profileIsEditable'] existence before using it in
is_profile_editable(). Update function comment.
Diego Escalante Urrelo %!s(int64=12) %!d(string=hai) anos
pai
achega
333ad5ec6d
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      main/auth/profile.php

+ 4 - 3
main/auth/profile.php

@@ -368,13 +368,14 @@ function is_platform_authentication()
 }
 
 /**
- * Can a user edit his/her profile?
+ * Returns whether a user can edit his/her profile. Defaults to false if
+ * profileIsEditable is not set in $GLOBALS.
  *
  * @return    boolean    Editability of the profile
  */
 function is_profile_editable()
 {
-    return $GLOBALS['profileIsEditable'];
+    return isset($GLOBALS['profileIsEditable']) ? $GLOBALS['profileIsEditable'] : false;
 }
 
 /*
@@ -837,4 +838,4 @@ if (api_get_setting('allow_social_tool') == 'true') {
     echo '</div>';
     $form->display();
 }
-Display :: display_footer();
+Display :: display_footer();