mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-09 16:44:26 +02:00
Replace deprecated defaults() calls by a combination of ?? and ?: operators in mod/
This commit is contained in:
parent
8998926e5b
commit
2db6171641
32 changed files with 186 additions and 189 deletions
|
@ -80,7 +80,7 @@ function dfrn_request_post(App $a)
|
|||
if (local_user() && ($a->user['nickname'] == $a->argv[1]) && !empty($_POST['dfrn_url'])) {
|
||||
$dfrn_url = Strings::escapeTags(trim($_POST['dfrn_url']));
|
||||
$aes_allow = !empty($_POST['aes_allow']);
|
||||
$confirm_key = defaults($_POST, 'confirm_key', "");
|
||||
$confirm_key = $_POST['confirm_key'] ?? '';
|
||||
$hidden = (!empty($_POST['hidden-contact']) ? intval($_POST['hidden-contact']) : 0);
|
||||
$contact_record = null;
|
||||
$blocked = 1;
|
||||
|
@ -169,7 +169,7 @@ function dfrn_request_post(App $a)
|
|||
$r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
DBA::escape($dfrn_url),
|
||||
defaults($parms, 'key', '') // Potentially missing
|
||||
$parms['key'] ?? '' // Potentially missing
|
||||
);
|
||||
if (DBA::isResult($r)) {
|
||||
Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
|
||||
|
@ -423,7 +423,7 @@ function dfrn_request_post(App $a)
|
|||
intval($uid),
|
||||
intval($contact_record['id']),
|
||||
intval(!empty($_POST['knowyou'])),
|
||||
DBA::escape(Strings::escapeTags(trim(defaults($_POST, 'dfrn-request-message', '')))),
|
||||
DBA::escape(Strings::escapeTags(trim($_POST['dfrn-request-message'] ?? ''))),
|
||||
DBA::escape($hash),
|
||||
DBA::escape(DateTimeFormat::utcNow())
|
||||
);
|
||||
|
@ -499,7 +499,7 @@ function dfrn_request_content(App $a)
|
|||
|
||||
$dfrn_url = Strings::escapeTags(trim(hex2bin($_GET['dfrn_url'])));
|
||||
$aes_allow = !empty($_GET['aes_allow']);
|
||||
$confirm_key = defaults($_GET, 'confirm_key', "");
|
||||
$confirm_key = $_GET['confirm_key'] ?? '';
|
||||
|
||||
// Checking fastlane for validity
|
||||
if (!empty($_SESSION['fastlane']) && (Strings::normaliseLink($_SESSION["fastlane"]) == Strings::normaliseLink($dfrn_url))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue