From: sam_marshall Date: Tue, 22 Jul 2008 14:09:32 +0000 (+0000) Subject: MDL-15773 - 'Pass by reference' errors in update from 1.9.1+ X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6a0d72d43df3771302a14eb6fac960dcf292061e;p=moodle.git MDL-15773 - 'Pass by reference' errors in update from 1.9.1+ --- diff --git a/lib/weblib.php b/lib/weblib.php index 3a3a8f75a6..173ab36ea7 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4676,7 +4676,8 @@ function print_table($table, $return=false) { if (!empty($table->head)) { $countcols = count($table->head); $output .= ''; - $lastkey = end(array_keys($table->head)); + $keys = array_keys($table->head); + $lastkey = end($keys); foreach ($table->head as $key => $heading) { if (!isset($size[$key])) { @@ -4698,7 +4699,8 @@ function print_table($table, $return=false) { if (!empty($table->data)) { $oddeven = 1; - $lastrowkey = end(array_keys($table->data)); + $keys=array_keys($table->data); + $lastrowkey = end($keys); foreach ($table->data as $key => $row) { $oddeven = $oddeven ? 0 : 1; if (!isset($table->rowclass[$key])) { @@ -4711,7 +4713,8 @@ function print_table($table, $return=false) { if ($row == 'hr' and $countcols) { $output .= '
'; } else { /// it's a normal row of data - $lastkey = end(array_keys($row)); + $keys2=array_keys($row); + $lastkey = end($keys2); foreach ($row as $key => $item) { if (!isset($size[$key])) { $size[$key] = '';