mirror of
https://github.com/friendica/friendica
synced 2025-04-24 05:10:11 +00:00
More parameter handling improved
This commit is contained in:
parent
6c767743d1
commit
fd4926b0f3
11 changed files with 27 additions and 32 deletions
|
@ -39,11 +39,9 @@ class Destroy extends BaseApi
|
|||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
|
||||
if (!empty($this->parameters['id'])) {
|
||||
$id = (int)$this->parameters['id'];
|
||||
} elseif (!empty($request['id'])) {
|
||||
$id = (int)$request['id'];
|
||||
} else {
|
||||
$id = $this->getRequestValue($request, 'id', 0);
|
||||
$id = $this->getRequestValue($this->parameters, 'id', $id);
|
||||
if (empty($id)) {
|
||||
throw new BadRequestException('An id is missing.');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue