We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 4bbb259b authored by Zach Copley's avatar Zach Copley

- Fix bad argument being passed (error code) when invalid format specified

- Reformat whitespace
parent 9bb48c36
...@@ -99,19 +99,27 @@ class ApiStatusesDestroyAction extends ApiAuthAction ...@@ -99,19 +99,27 @@ class ApiStatusesDestroyAction extends ApiAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(
_('API method not found.'),
404
);
return; return;
} }
if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
$this->clientError(_('This method requires a POST or DELETE.'), $this->clientError(
400, $this->format); _('This method requires a POST or DELETE.'),
400,
$this->format
);
return; return;
} }
if (empty($this->notice)) { if (empty($this->notice)) {
$this->clientError(_('No status found with that ID.'), $this->clientError(
404, $this->format); _('No status found with that ID.'),
404, $this->format
);
return; return;
} }
...@@ -122,8 +130,11 @@ class ApiStatusesDestroyAction extends ApiAuthAction ...@@ -122,8 +130,11 @@ class ApiStatusesDestroyAction extends ApiAuthAction
$this->notice->delete(); $this->notice->delete();
$this->showNotice(); $this->showNotice();
} else { } else {
$this->clientError(_('You may not delete another user\'s status.'), $this->clientError(
403, $this->format); _('You may not delete another user\'s status.'),
403,
$this->format
);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment