mirror of
https://github.com/friendica/friendica
synced 2025-04-24 04:30:11 +00:00
Replace deprecated defaults() calls by ?? and ?: operators in src/Module/
This commit is contained in:
parent
8998926e5b
commit
f59ea2af55
40 changed files with 115 additions and 94 deletions
|
@ -28,7 +28,7 @@ class Xrd extends BaseModule
|
|||
}
|
||||
|
||||
$uri = urldecode(Strings::escapeTags(trim($_GET['uri'])));
|
||||
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/jrd+json') {
|
||||
if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/jrd+json') {
|
||||
$mode = 'json';
|
||||
} else {
|
||||
$mode = 'xml';
|
||||
|
@ -39,7 +39,7 @@ class Xrd extends BaseModule
|
|||
}
|
||||
|
||||
$uri = urldecode(Strings::escapeTags(trim($_GET['resource'])));
|
||||
if (defaults($_SERVER, 'HTTP_ACCEPT', '') == 'application/xrd+xml') {
|
||||
if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/xrd+xml') {
|
||||
$mode = 'xml';
|
||||
} else {
|
||||
$mode = 'json';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue