diff options
author | Zach Copley <zach@status.net> | 2010-07-29 18:47:28 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-07-29 18:47:28 +0000 |
commit | 4e8e77f6b091e024f58241c2807c61e0b7930e5c (patch) | |
tree | d013fb2601d2370c447b7bf608a14472f2d05ec3 | |
parent | db90bcb3293985818e2645827ed5a568f27d1511 (diff) |
Return HTTP 403 instead of 400 when silenced users try to post via API
-rw-r--r-- | actions/apistatusesupdate.php | 2 | ||||
-rw-r--r-- | classes/Notice.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/actions/apistatusesupdate.php b/actions/apistatusesupdate.php index d65a068f5..9be16b2c5 100644 --- a/actions/apistatusesupdate.php +++ b/actions/apistatusesupdate.php @@ -332,7 +332,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction $options ); } catch (Exception $e) { - $this->clientError($e->getMessage()); + $this->clientError($e->getMessage(), $e->getCode()); return; } diff --git a/classes/Notice.php b/classes/Notice.php index 8552248ba..36943be84 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -275,7 +275,7 @@ class Notice extends Memcached_DataObject if (!$profile->hasRight(Right::NEWNOTICE)) { common_log(LOG_WARNING, "Attempted post from user disallowed to post: " . $profile->nickname); - throw new ClientException(_('You are banned from posting notices on this site.')); + throw new ClientException(_('You are banned from posting notices on this site.'), 403); } $notice = new Notice(); |