Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit b5206fe6ca455684af46bcf05153716749a611a9 1 parent 22a0cf6
@evanp evanp authored
Showing with 13 additions and 3 deletions.
  1. +13 −3 classes/User.php
View
16 classes/User.php
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.