Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions phpBB/admin/admin_user_ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@
$db->sql_freeresult($result);

$select_userlist = '';
for($i = 0; $i < count($user_list); $i++)
$x = $user_list ? count($user_list) : 0;
for($i = 0; $i < $x; $i++)
{
$select_userlist .= '<option value="' . $user_list[$i]['ban_id'] . '">' . $user_list[$i]['username'] . '</option>';
$userban_count++;
Expand All @@ -397,8 +398,8 @@

$select_iplist = '';
$select_emaillist = '';

for($i = 0; $i < count($banlist); $i++)
$x = $banlist ? count($banlist) : 0;
for($i = 0; $i < $x; $i++)
{
$ban_id = $banlist[$i]['ban_id'];

Expand Down
2 changes: 1 addition & 1 deletion phpBB/admin/admin_words.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@

$word_rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$word_count = count($word_rows);
$word_count = $word_rows ? count($word_rows) : 0;

$template->assign_vars(array(
"L_WORDS_TITLE" => $lang['Words_title'],
Expand Down
2 changes: 1 addition & 1 deletion phpBB/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function inarray($needle, $haystack)
//
// Guest users
//
if( count($onlinerow_guest) )
if( $onlinerow_guest ? count($onlinerow_guest) : 0)
{
$guest_users = 0;

Expand Down
6 changes: 3 additions & 3 deletions phpBB/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@
{
$last_post = $lang['No_Posts'];
}

if ( count($forum_moderators[$forum_id]) > 0 )
if ( count($forum_moderators[$forum_id] ?? [] ) > 0 )
{
$l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$moderator_list = implode(', ', $forum_moderators[$forum_id]);
Expand Down Expand Up @@ -470,4 +470,4 @@

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
?>