mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-10 09:04:26 +02:00
More parameter handling improved
This commit is contained in:
parent
6c767743d1
commit
fd4926b0f3
11 changed files with 27 additions and 32 deletions
|
@ -36,7 +36,7 @@ class Show extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
|
||||
|
||||
// params
|
||||
$gid = $this->getRequestValue($request, 'gid', 0);
|
||||
|
|
|
@ -48,7 +48,7 @@ class Photo extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
|
||||
|
||||
if (empty($request['photo_id'])) {
|
||||
throw new HTTPException\BadRequestException('No photo id.');
|
||||
|
|
|
@ -52,7 +52,7 @@ class Create extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
|
||||
|
||||
// input params
|
||||
$desc = $this->getRequestValue($request, 'desc');
|
||||
|
|
|
@ -54,7 +54,7 @@ class Lists extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
|
||||
|
||||
$photos = Photo::selectToArray(['resource-id'], ["`uid` = ? AND NOT `photo-type` IN (?, ?)", $uid, Photo::CONTACT_AVATAR, Photo::CONTACT_BANNER],
|
||||
['order' => ['id'], 'group_by' => ['resource-id']]);
|
||||
|
|
|
@ -52,7 +52,7 @@ class Update extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
$type = $this->parameters['extension'] ?? '';
|
||||
$type = $this->getRequestValue($this->parameters, 'extension', 'json');
|
||||
|
||||
// input params
|
||||
$photo_id = $this->getRequestValue($request, 'photo_id');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue