1
1
Fork 0

Replace x() by isset(), !empty() or defaults()

- Remove extraneous parentheses around empty() calls
- Remove duplicate calls to intval(), count() or strlen() after empty()
- Replace ternary operators outputting binary value with empty() return value
- Rewrite defaults() without x()
This commit is contained in:
Hypolite Petovan 2018-11-30 09:06:22 -05:00
commit 458981f75c
101 changed files with 896 additions and 914 deletions

View file

@ -54,7 +54,7 @@ function poke_init(App $a)
return;
}
$parent = (x($_GET,'parent') ? intval($_GET['parent']) : 0);
$parent = (!empty($_GET['parent']) ? intval($_GET['parent']) : 0);
Logger::log('poke: verb ' . $verb . ' contact ' . $contact_id, Logger::DEBUG);
@ -86,7 +86,7 @@ function poke_init(App $a)
$deny_gid = $item['deny_gid'];
}
} else {
$private = (x($_GET,'private') ? intval($_GET['private']) : 0);
$private = (!empty($_GET['private']) ? intval($_GET['private']) : 0);
$allow_cid = ($private ? '<' . $target['id']. '>' : $a->user['allow_cid']);
$allow_gid = ($private ? '' : $a->user['allow_gid']);
@ -169,7 +169,7 @@ function poke_content(App $a)
]);
$parent = (x($_GET,'parent') ? intval($_GET['parent']) : '0');
$parent = (!empty($_GET['parent']) ? intval($_GET['parent']) : '0');
$verbs = L10n::getPokeVerbs();