Add in a check for proper format
This commit is contained in:
parent
2b7d8d0c29
commit
62d1475df1
@ -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.'),
|
||||
|
Loading…
Reference in New Issue
Block a user