Variable is initialized as string but later written to as array, throws fatal error in PHP 7.1
I'm putting ISPConfig through the paces with PHP 7.1 (released as stable on Dec 01, 2016) and there is a change that causes PHP to throw a fatal error in at least one instance:
Fatal error: Uncaught Error: [] operator not supported for strings in /usr/local/ispconfig/interface/lib/classes/listform_actions.inc.php:138
interface/lib/classes/listform_actions.inc.php:134
The offending code looks like this:
$records_new = '';
if(is_array($records)) {
$this->idx_key = $app->listform->listDef["table_idx"];
foreach($records as $rec) {
$records_new[] = $this->prepareDataRow($rec);
}
}
That first line needs to be changed to $records_new = [];
.