Merge pull request #4909 from MrPetovan/bug/4898-fix-php-72-warnings

Fix PHP 7.2 warnings
This commit is contained in:
Michael Vogel 2018-04-23 06:50:21 +02:00 committed by GitHub
commit b1a668a3ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 12 deletions

View file

@ -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;
}

View file

@ -122,8 +122,8 @@ function friendica_content(App $a)
$o .= '<p>'.L10n::t('Read about the <a href="%1$s/tos">Terms of Service</a> of this node.', System::baseurl()).'</p>';
}
$blocklist = Config::get('system', 'blocklist');
if (count($blocklist)) {
$blocklist = Config::get('system', 'blocklist', []);
if (!empty($blocklist)) {
$o .= '<div id="about_blocklist"><p>' . L10n::t('On this server the following remote servers are blocked.') . '</p>' . PHP_EOL;
$o .= '<table class="table"><thead><tr><th>' . L10n::t('Blocked domain') . '</th><th>' . L10n::t('Reason for the block') . '</th></thead><tbody>' . PHP_EOL;
foreach ($blocklist as $b) {

View file

@ -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'),

View file

@ -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']) {

View file

@ -59,7 +59,7 @@ class Temporal
$o = '<select id="timezone_select" name="timezone">';
usort($timezone_identifiers, [self, 'timezoneCompareCallback']);
usort($timezone_identifiers, [__CLASS__, 'timezoneCompareCallback']);
$continent = '';
foreach ($timezone_identifiers as $value) {
$ex = explode("/", $value);