mirror of
https://github.com/friendica/friendica
synced 2025-04-25 05:10:11 +00:00
API: Parameter cleanup
This commit is contained in:
parent
453e6a9d75
commit
e3d227f3c9
22 changed files with 147 additions and 80 deletions
|
@ -57,15 +57,18 @@ class Lists extends BaseApi
|
|||
self::login(self::SCOPE_WRITE);
|
||||
|
||||
$uid = self::getCurrentUserID();
|
||||
$title = $_REQUEST['title'] ?? '';
|
||||
|
||||
if (empty($title)) {
|
||||
$request = self::getRequest([
|
||||
'title' => '',
|
||||
]);
|
||||
|
||||
if (empty($request['title'])) {
|
||||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
Group::create($uid, $title);
|
||||
Group::create($uid, $request['title']);
|
||||
|
||||
$id = Group::getIdByName($uid, $title);
|
||||
$id = Group::getIdByName($uid, $request['title']);
|
||||
if (!$id) {
|
||||
DI::mstdnError()->InternalError();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue