mirror of
https://github.com/friendica/friendica
synced 2025-04-24 06:30:13 +00:00
Changed:
- used `$this->getRequestValue($request, 'foo', <bar>)` instead of `$request['foo'] ?? <bar>` - fixed wrong variable naming - changed double-quotes to single - see https://github.com/friendica/friendica/issues/11631#issuecomment-1196410497
This commit is contained in:
parent
5ec407699b
commit
eaed3945d1
21 changed files with 28 additions and 30 deletions
|
@ -63,7 +63,7 @@ class Destroy extends ContactEndpoint
|
|||
throw new HTTPException\NotFoundException('Error Processing Request');
|
||||
}
|
||||
|
||||
$contact_id = BaseApi::getContactIDForSearchterm($request['screen_name'] ?? '', $request['profileurl'] ?? '', $request['user_id'] ?? 0, 0);
|
||||
$contact_id = BaseApi::getContactIDForSearchterm($this->getRequestValue($request, 'screen_name', ''), $this->getRequestValue($request, 'profileurl', ''), $this->getRequestValue($request, 'user_id', 0), 0);
|
||||
|
||||
if (empty($contact_id)) {
|
||||
Logger::notice(BaseApi::LOG_PREFIX . 'No user_id specified', ['module' => 'api', 'action' => 'friendships_destroy']);
|
||||
|
|
|
@ -38,9 +38,8 @@ class Show extends ContactEndpoint
|
|||
self::checkAllowedScope(self::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
|
||||
$source_cid = BaseApi::getContactIDForSearchterm($request['source_screen_name'] ?? '', '', $request['source_id'] ?? 0, $uid);
|
||||
|
||||
$target_cid = BaseApi::getContactIDForSearchterm($request['target_screen_name'] ?? '', '', $request['target_id'] ?? 0, $uid);
|
||||
$source_cid = BaseApi::getContactIDForSearchterm($this->getRequestValue($request, 'source_screen_name', ''), '', $this->getRequestValue($request, 'source_id', 0), $uid);
|
||||
$target_cid = BaseApi::getContactIDForSearchterm($this->getRequestValue($request, 'target_screen_name', ''), '', $this->getRequestValue($request, 'target_id', 0), $uid);
|
||||
|
||||
$source = Contact::getById($source_cid);
|
||||
if (empty($source)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue