From c4a604a984f26bb2b044bf7d152bd7b9c535f97c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 18 Sep 2009 13:57:13 +0000 Subject: [PATCH] Shut up warnings from r56420 that have annoyed us few days :o --- includes/LogEventsList.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index c5abc23f2a..29a54c6f31 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -583,7 +583,18 @@ class LogEventsList { * @return Integer Number of total log items (not limited by $lim) */ public static function showLogExtract( &$out, $types=array(), $page='', $user='', - $param = array( 'lim' => 0, 'conds' => array(), 'showIfEmpty' => true, 'msgKey' => array('') ) ) { + $param = array() ) { + + $defaultParameters = array( + 'lim' => 0, + 'conds' => array(), + 'showIfEmpty' => true, + 'msgKey' => array('') + ); + + # The + operator appends elements of remaining keys from the right + # handed array to the left handed, whereas duplicated keys are NOT overwritten. + $param += $defaultParameters; global $wgUser, $wgOut; # Convert $param array to individual variables @@ -591,7 +602,7 @@ class LogEventsList { $conds = $param['conds']; $showIfEmpty = $param['showIfEmpty']; $msgKey = $param['msgKey']; - if ( !(is_array($msgKey)) ) + if ( !is_array($msgKey) ) $msgKey = array( $msgKey ); # Insert list of top 50 (or top $lim) items $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 ); -- 2.20.1