johndoh/roundcube-sauserprefs

count() on none arrays gives errors in php7

Closed this issue · 3 comments

In sauserprefs.php count() is used to test if a variable is/contains an array. But when it the variable is empty php7 throws a soft error. On my system I solved this by replacing count() with is_array() and in the case that the value of count was needed a combination of the two.

I could make these changes on git myself, but am new to git so have no clue yet how to.

I don't see any warnings but may be it only happens in certain cases. Please provide the message from you log.

The warnings are PHP warnings that show up in the user interface in the back-end, they do not appear in the logs. All but one are in the section under case 'addresses'.
They only occur when there are no addresses (whilte- and blacklisted addresses). If you want I can reinstall and give you the a list of the rules that I changed.

I think this is probably fixed in git-master. If not please reopen and provide the error message.