Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 130709

Array variable declarations in 2 files cause errors (white screens)

$
0
0

Replies: 0

PHP 7.1.2
Fatal error: Uncaught Error: [] operator not supported for strings

Error 1
Symptom:
Attempting to edit a group – admin page does not load the update forms. Halts on line 31, groups-edit.php.

Issue:
$meta_array is initialized as a string on line 30 – $meta_array = ”;

Fix:
Initialize the variable as an array – $meta_array = [];

Error 2
Symptom:
Attempting to save an advert that is in a group, admin page fails to reload leaving a blank white screen.

Issue:
$group_array is initialized as a string in adrotate-manage-publisher.php – line 58
$groups = $type = $group_array = ”;

Fix:
Initialize the variable as an array –
$groups = $type = $group_array = [];

I guess PHP has become much pickier about its variable declarations in its old age.


Viewing all articles
Browse latest Browse all 130709

Trending Articles