]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / lib / util.php
index 08a0cdea2fac9f736e164ac0e01e0a3f1bccd2c9..b0a7eeb7409ef831674a342a0139c5b1f13ed56a 100644 (file)
@@ -322,7 +322,7 @@ function common_set_user($user)
         return false;
     }
 
-    if ($user) {
+    if ($user instanceof User) {
         if (Event::handle('StartSetUser', array(&$user))) {
             if (!empty($user)) {
                 if (!$user->hasRight(Right::WEBLOGIN)) {
@@ -538,7 +538,7 @@ function common_user_cache_hash($user=false)
     if ($user === false) {
         $user = common_current_user();
     }
-    if ($user) {
+    if ($user instanceof User) {
         return crc32($user->id . ':' . $user->nickname);
     } else {
         return '0';