1
0
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

@ -166,7 +166,7 @@ function item_post(App $a) {
// Now check that valid personal details have been provided
if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
notice(L10n::t('Permission denied.') . EOL) ;
notice(L10n::t('Permission denied.') . EOL);
if (!empty($_REQUEST['return'])) {
$a->internalRedirect($return_path);
@ -690,7 +690,7 @@ function item_post(App $a) {
}
$json = ['cancel' => 1];
if (!empty($_REQUEST['jsreload']) && strlen($_REQUEST['jsreload'])) {
if (!empty($_REQUEST['jsreload'])) {
$json['reload'] = System::baseUrl() . '/' . $_REQUEST['jsreload'];
}
@ -869,7 +869,7 @@ function item_post_return($baseurl, $api_source, $return_path)
}
$json = ['success' => 1];
if (!empty($_REQUEST['jsreload']) && strlen($_REQUEST['jsreload'])) {
if (!empty($_REQUEST['jsreload'])) {
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}