Skip to content

Changes for fix Warnings...#2

Open
Phosphorus-M wants to merge 6 commits into
ebourg:2.0.23.xfrom
Phosphorus-M:patch-1
Open

Changes for fix Warnings...#2
Phosphorus-M wants to merge 6 commits into
ebourg:2.0.23.xfrom
Phosphorus-M:patch-1

Conversation

@Phosphorus-M
Copy link
Copy Markdown

@Phosphorus-M Phosphorus-M commented Apr 18, 2019

Fixed the message "Warning: count()" In the index when is installed phpbb2.

I have a this messages in the Index and the admin panel.
image
And i fix the messages with this branch...

Fixed the message "Warning: count()" In the index when is installed phpbb2 and you not have a moderator
@Phosphorus-M Phosphorus-M changed the title Update index.php Changes for fix Warnings... Apr 18, 2019
@ebourg
Copy link
Copy Markdown
Owner

ebourg commented Apr 18, 2019

Thank you for the fix Fernando! I'm going to merge it (without the captcha change though since it's unrelated).

Comment thread phpBB/index.php Outdated
}

if ( count($forum_moderators[$forum_id]) > 0 )
if ( count($forum_moderators[$forum_id] ?? $forum_moderators ) > 0 )
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work instead? :
if (isset($forum_moderators[$forum_id]) && count($forum_moderators[$forum_id]) > 0)
Using $forum_moderators as the default argument for count()when the forum_id is missing isn't very intuitive.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True story, sorry haha

@Phosphorus-M
Copy link
Copy Markdown
Author

This is better 🤙 ... or no...

@vendethiel
Copy link
Copy Markdown

FWIW IntegraMOD ended up with a count_safe function

@ebourg
Copy link
Copy Markdown
Owner

ebourg commented Sep 5, 2020

@vendethiel Would you want to contribute the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants