GitHost.io will be shut down on June 1, 2019. At that point this instance will be unreachable and all data will be irrevocably deleted. More details at https://about.gitlab.com/gitlab-hosted/#githost-is-shutting-down-on-june-1st-2019

Commit 62d1475d authored by Zach Copley's avatar Zach Copley

Add in a check for proper format

parent 2b7d8d0c
......@@ -101,6 +101,15 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
return;
}
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
_('API method not found!'),
404,
$this->format
);
return;
}
if (empty($this->other)) {
$this->clientError(
_('Could not follow user: User not found.'),
......
......@@ -101,6 +101,15 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
return;
}
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
_('API method not found!'),
404,
$this->format
);
return;
}
if (empty($this->other)) {
$this->clientError(
_('Could not unfollow user: User not found.'),
......
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