From fcc97c87d17187b2d2ee97f2d9619fab231b2205 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 21 Jan 2015 22:06:27 +0100 Subject: [PATCH] Only check if a nickname exists if site is non-private --- actions/apichecknickname.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actions/apichecknickname.php b/actions/apichecknickname.php index 73063c61b7..e714443c26 100644 --- a/actions/apichecknickname.php +++ b/actions/apichecknickname.php @@ -5,7 +5,7 @@ * * Check nickname * - * Returns 1 if nickname is ok, 0 if not + * Returns 1 if nickname is available on this instance, 0 if not. Error if site is private. * * PHP version 5 * @@ -38,6 +38,10 @@ class ApiCheckNicknameAction extends ApiAction { parent::prepare($args); + if (common_config('site', 'private')) { + throw new ClientException(_('This site is private.'), 403); + } + if ($this->format !== 'json') { $this->clientError('This method currently only serves JSON.', 415); }