From 2eaa5161b11d1ee6e1b6b5724b6eed663bcf6a2e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 2 May 2009 13:42:51 +0000 Subject: [PATCH] Fixed total log breakage due to type safety issues --- includes/LogEventsList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index b4b36f3834..39e9e5aa9c 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -546,7 +546,7 @@ class LogPager extends ReverseChronologicalPager { private function limitType( $types ) { global $wgLogRestrictions, $wgUser; // If $types is not an array, make it an array - $types = (array)$types; + $types = ($types === '') ? array() : (array)$types; // Don't even show header for private logs; don't recognize it... foreach ( $types as $type ) { if( isset( $wgLogRestrictions[$type] ) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) { @@ -560,7 +560,7 @@ class LogPager extends ReverseChronologicalPager { if( $hideLogs !== false ) { $this->mConds[] = $hideLogs; } - if( $types ) { + if( count($types) > 0 ) { $this->type = $types; $this->mConds['log_type'] = $types; } -- 2.20.1