Permalink
Browse files

fall back to siteowner on bad nickname (Bug#2861)

  • Loading branch information...
1 parent 22a0cf6 commit b5206fe6ca455684af46bcf05153716749a611a9 @evanp evanp committed Oct 28, 2010
Showing with 13 additions and 3 deletions.
  1. +13 −3 classes/User.php
View
@@ -889,13 +889,23 @@ static function siteOwner()
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.

0 comments on commit b5206fe

Please sign in to comment.