r96443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96442‎ | r96443 | r96444 >
Date:16:09, 7 September 2011
Author:nikerabbit
Status:resolved
Tags:
Comment:
Validate log type here, and moved showHeader to the special page where it belongs.
LogEventsList::showHeader still kept, because one extension calls it.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialLog.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialLog.php
@@ -64,6 +64,10 @@
6565 $opts->setValue( 'month', '' );
6666 }
6767
 68+ if ( LogPage::isLogType( $opts->getValue( 'type' ) ) ) {
 69+ $opts->setValue( 'type', '' );
 70+ }
 71+
6872 # Handle type-specific inputs
6973 $qc = array();
7074 if ( $opts->getValue( 'type' ) == 'suppress' ) {
@@ -103,8 +107,7 @@
104108 $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
105109 $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
106110
107 - # Set title and add header
108 - $loglist->showHeader( $pager->getType() );
 111+ $this->addHeader( $opts->getValue( 'type' ) );
109112
110113 # Set relevant user
111114 if ( $pager->getUser() ) {
@@ -129,4 +132,16 @@
130133 $wgOut->addWikiMsg( 'logempty' );
131134 }
132135 }
 136+
 137+ /**
 138+ * Set page title and show header for this log type
 139+ * @param $type string
 140+ * @since 1.19
 141+ */
 142+ protected function addHeader( $type ) {
 143+ $page = new LogPage( $type );
 144+ $this->getOutput()->setPageTitle( $page->getName()->text() );
 145+ $this->getOutput()->addHTML( $page->getDescription()->parseAsBlock() );
 146+ }
 147+
133148 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r96444Ffixes to r96443 and r96441nikerabbit16:11, 7 September 2011

Status & tagging log