Преглед на файлове

auth/profile.php: fix index warning

Check for $GLOBALS['profileIsEditable'] existence before using it in
is_profile_editable(). Update function comment.
Diego Escalante Urrelo преди 12 години
родител
ревизия
333ad5ec6d
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  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();