diff --git a/include/dba.php b/include/dba.php index bac61ec2f5..d2f631c064 100644 --- a/include/dba.php +++ b/include/dba.php @@ -971,7 +971,7 @@ class dba { // Split the SQL queries in chunks of 100 values // We do the $i stuff here to make the code better readable $i = $counter[$key_table][$key_condition]; - if (count($compacted[$key_table][$key_condition][$i]) > 100) { + if (isset($compacted[$key_table][$key_condition][$i]) && count($compacted[$key_table][$key_condition][$i]) > 100) { ++$i; } diff --git a/mod/friendica.php b/mod/friendica.php index 6c143634ca..1929150f27 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -116,14 +116,14 @@ function friendica_content(App $a) } else { $o .= '

' . L10n::t('No installed addons/apps') . '

' . PHP_EOL; } - + if (Config::get('system', 'tosdisplay')) { $o .= '

'.L10n::t('Read about the Terms of Service of this node.', System::baseurl()).'

'; } - $blocklist = Config::get('system', 'blocklist'); - if (count($blocklist)) { + $blocklist = Config::get('system', 'blocklist', []); + if (!empty($blocklist)) { $o .= '

' . L10n::t('On this server the following remote servers are blocked.') . '

' . PHP_EOL; $o .= '' . PHP_EOL; foreach ($blocklist as $b) { diff --git a/src/Model/Profile.php b/src/Model/Profile.php index cd8fa29e13..f86fce9b21 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -92,14 +92,14 @@ class Profile { $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]); - if (!$user && !count($user) && !count($profiledata)) { + if (!DBM::is_result($user) && empty($profiledata)) { logger('profile error: ' . $a->query_string, LOGGER_DEBUG); notice(L10n::t('Requested account is not available.') . EOL); $a->error = 404; return; } - if (!x($a->page, 'aside')) { + if (empty($a->page['aside'])) { $a->page['aside'] = ''; } @@ -157,10 +157,6 @@ class Profile require_once $theme_info_file; } - if (!x($a->page, 'aside')) { - $a->page['aside'] = ''; - } - if (local_user() && local_user() == $a->profile['uid'] && $profiledata) { $a->page['aside'] .= replace_macros( get_markup_template('profile_edlink.tpl'), diff --git a/src/Object/Post.php b/src/Object/Post.php index 86e1414678..820730a32b 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -78,7 +78,7 @@ class Post extends BaseObject } // Prepare the children - if (count($data['children'])) { + if (!empty($data['children'])) { foreach ($data['children'] as $item) { // Only add will be displayed if ($item['network'] === NETWORK_MAIL && local_user() != $item['uid']) { diff --git a/src/Util/Temporal.php b/src/Util/Temporal.php index 1ed08ed1df..46bd8bba50 100644 --- a/src/Util/Temporal.php +++ b/src/Util/Temporal.php @@ -59,7 +59,7 @@ class Temporal $o = '
' . L10n::t('Blocked domain') . '' . L10n::t('Reason for the block') . '