]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fall back to siteowner on bad nickname (Bug#2861)
authorEvan Prodromou <evan@status.net>
Thu, 28 Oct 2010 14:46:57 +0000 (10:46 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 28 Oct 2010 14:46:57 +0000 (10:46 -0400)
classes/User.php

index f381ec6070eeba6e1ea61d6bbb58e95a8126d859..7345dc7f94ad68aa31277d4a9a21ad4d0a21d00e 100644 (file)
@@ -889,13 +889,23 @@ class User extends Memcached_DataObject
     static function singleUser()
     {
         if (common_config('singleuser', 'enabled')) {
+
+            $user = null;
+
             $nickname = common_config('singleuser', 'nickname');
-            if ($nickname) {
+
+            if (!empty($nickname)) {
                 $user = User::staticGet('nickname', $nickname);
-            } else {
+            }
+
+            // if there was no nickname or no user by that nickname,
+            // try the site owner.
+
+            if (empty($user)) {
                 $user = User::siteOwner();
             }
-            if ($user) {
+
+            if (!empty($user)) {
                 return $user;
             } else {
                 // TRANS: Server exception.