MyBB Community Forums

Full Version: $errors array needs explicit declaration in member.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Since PHP 7.1, arrays need explicitly declaring; you can no longer implicitly cast an empty string to an empty array.

Quote:As of PHP 7.1.0, applying the empty index operator on a string throws a fatal error. Formerly, the string was silently converted to an array.
(http://php.net/manual/en/language.types.array.php)

In member.php, line 255 causes an error if the Captcha test fails. It assumes $errors is already an array.

We need to replace (line 205)

$errors = "";

with

$errors = array();
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/2765

Thanks for contributing to MyBB!

Regards,
The MyBB Group