From 5f6f6dc2d84974fcdb7e0e5a9dea5a4bce6277fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 7 Sep 2011 16:09:24 +0000 Subject: [PATCH] Validate log type here, and moved showHeader to the special page where it belongs. LogEventsList::showHeader still kept, because one extension calls it. --- includes/specials/SpecialLog.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialLog.php b/includes/specials/SpecialLog.php index d8f6d8cff0..5d0771be66 100644 --- a/includes/specials/SpecialLog.php +++ b/includes/specials/SpecialLog.php @@ -64,6 +64,10 @@ class SpecialLog extends SpecialPage { $opts->setValue( 'month', '' ); } + if ( LogPage::isLogType( $opts->getValue( 'type' ) ) ) { + $opts->setValue( 'type', '' ); + } + # Handle type-specific inputs $qc = array(); if ( $opts->getValue( 'type' ) == 'suppress' ) { @@ -103,8 +107,7 @@ class SpecialLog extends SpecialPage { $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ), $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) ); - # Set title and add header - $loglist->showHeader( $pager->getType() ); + $this->addHeader( $opts->getValue( 'type' ) ); # Set relevant user if ( $pager->getUser() ) { @@ -129,4 +132,16 @@ class SpecialLog extends SpecialPage { $wgOut->addWikiMsg( 'logempty' ); } } + + /** + * Set page title and show header for this log type + * @param $type string + * @since 1.19 + */ + protected function addHeader( $type ) { + $page = new LogPage( $type ); + $this->getOutput()->setPageTitle( $page->getName()->text() ); + $this->getOutput()->addHTML( $page->getDescription()->parseAsBlock() ); + } + } -- 2.20.1