From: Evan Prodromou Date: Thu, 28 Oct 2010 14:46:57 +0000 (-0400) Subject: fall back to siteowner on bad nickname (Bug#2861) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b5206fe6ca455684af46bcf05153716749a611a9;p=quix0rs-gnu-social.git fall back to siteowner on bad nickname (Bug#2861) --- diff --git a/classes/User.php b/classes/User.php index f381ec6070..7345dc7f94 100644 --- a/classes/User.php +++ b/classes/User.php @@ -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.