SortableTable::get_additional_url_paramstring() - http_build_query() throws fatal error

SortableTable::get_additional_url_paramstring()
The first http_build_query() throws fatal error when $this->additional_parameters is not an array

The error surfaced when viewing the index of an "Attendances" tool. (main/attendance/index.php)
pull/4643/head
TheTomcat14 3 years ago committed by Angel Fernando Quiroz Campos
parent ceeb46dfe4
commit 044dd6c424
  1. 7
      main/inc/lib/sortable_table.class.php

@ -975,7 +975,10 @@ class SortableTable extends HTML_Table
*/
public function get_additional_url_paramstring()
{
$result = http_build_query($this->additional_parameters);
$result = '';
if (is_array($this->additional_parameters)) {
$result = http_build_query($this->additional_parameters);
}
foreach ($this->other_tables as $index => &$tablename) {
$param = [];
if (isset($_GET[$tablename.'_direction'])) {
@ -996,7 +999,7 @@ class SortableTable extends HTML_Table
$param[$tablename.'_column'] = intval($_GET[$tablename.'_column']);
}
if (count($param) > 0) {
$result .= '&'.http_build_query($param);
$result .= (strlen($result) > 0 ? '&' : '').http_build_query($param);
}
}

Loading…
Cancel
Save