Skip to content

Commit

Permalink
MDL-15773 - 'Pass by reference' errors in update from 1.9.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
sam_marshall committed Jul 22, 2008
1 parent a8dc4f7 commit 0e8a3a6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/weblib.php
Expand Up @@ -4744,11 +4744,12 @@ function print_table($table, $return=false) {
$output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class boxalign$table->tablealign\" $tableid>\n"; $output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class boxalign$table->tablealign\" $tableid>\n";


$countcols = 0; $countcols = 0;

if (!empty($table->head)) { if (!empty($table->head)) {
$countcols = count($table->head); $countcols = count($table->head);
$output .= '<tr>'; $output .= '<tr>';
$lastkey = end(array_keys($table->head)); $keys=array_keys($table->head);
$lastkey = end($keys);
foreach ($table->head as $key => $heading) { foreach ($table->head as $key => $heading) {


if (!isset($size[$key])) { if (!isset($size[$key])) {
Expand All @@ -4770,7 +4771,8 @@ function print_table($table, $return=false) {


if (!empty($table->data)) { if (!empty($table->data)) {
$oddeven = 1; $oddeven = 1;
$lastrowkey = end(array_keys($table->data)); $keys=array_keys($table->data);
$lastrowkey = end($keys);
foreach ($table->data as $key => $row) { foreach ($table->data as $key => $row) {
$oddeven = $oddeven ? 0 : 1; $oddeven = $oddeven ? 0 : 1;
if (!isset($table->rowclass[$key])) { if (!isset($table->rowclass[$key])) {
Expand All @@ -4783,7 +4785,8 @@ function print_table($table, $return=false) {
if ($row == 'hr' and $countcols) { if ($row == 'hr' and $countcols) {
$output .= '<td colspan="'. $countcols .'"><div class="tabledivider"></div></td>'; $output .= '<td colspan="'. $countcols .'"><div class="tabledivider"></div></td>';
} else { /// it's a normal row of data } 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) { foreach ($row as $key => $item) {
if (!isset($size[$key])) { if (!isset($size[$key])) {
$size[$key] = ''; $size[$key] = '';
Expand Down

0 comments on commit 0e8a3a6

Please sign in to comment.