From: Niklas Laxström Date: Fri, 20 Jan 2012 19:09:55 +0000 (+0000) Subject: Can't PHP just DWIM? Ping r109628 X-Git-Tag: 1.31.0-rc.0~25162 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2ad96d59c8b8c6cde661628d779262efa93f477e;p=lhc%2Fweb%2Fwiklou.git Can't PHP just DWIM? Ping r109628 --- diff --git a/includes/logging/LogFormatter.php b/includes/logging/LogFormatter.php index 00c194b041..cae6cb9c35 100644 --- a/includes/logging/LogFormatter.php +++ b/includes/logging/LogFormatter.php @@ -178,10 +178,12 @@ class LogFormatter { * Fill in missing indexes with empty strings to avoid * incorrect renumbering. */ - $max = max( array_keys( $params ) ); - for ( $i = 4; $i < $max; $i++ ) { - if ( !isset( $params[$i] ) ) { - $params[$i] = ''; + if ( count( $params ) ) { + $max = max( array_keys( $params ) ); + for ( $i = 4; $i < $max; $i++ ) { + if ( !isset( $params[$i] ) ) { + $params[$i] = ''; + } } } return $params;