Removed useless $title parameter to InfoAction::pageInfo()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 7 Oct 2012 13:37:00 +0000 (15:37 +0200)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Tue, 9 Oct 2012 08:56:25 +0000 (10:56 +0200)
The $title variable is set to $this->getTitle() before its
first use in that method, so it's useless to pass it as parameter.

Also changed the call to exist() in InfoAction::onView() to use
the Page object instead of the Title object.

Change-Id: Ic07ee0ccccfd9cc3aabd497aebf7965136a2d3bd

includes/actions/InfoAction.php

index e09cd20..468e21b 100644 (file)
@@ -72,8 +72,7 @@ class InfoAction extends FormlessAction {
                        '.mw-templatesUsedExplanation { display: none; }' );
 
                // Get page information
-               $title = $this->getTitle();
-               $pageInfo = $this->pageInfo( $title );
+               $pageInfo = $this->pageInfo();
 
                // Allow extensions to add additional information
                wfRunHooks( 'InfoAction', array( &$pageInfo ) );
@@ -96,7 +95,7 @@ class InfoAction extends FormlessAction {
                }
 
                // Page credits
-               /*if ( $title->exists() ) {
+               /*if ( $this->page->exists() ) {
                        $content .= Html::rawElement( 'div', array( 'id' => 'mw-credits' ), $this->getContributors() );
                }*/
 
@@ -146,10 +145,8 @@ class InfoAction extends FormlessAction {
         * Returns page information in an easily-manipulated format. Array keys are used so extensions
         * may add additional information in arbitrary positions. Array values are arrays with one
         * element to be rendered as a header, arrays with two elements to be rendered as a table row.
-        *
-        * @param $title Title object
         */
-       protected function pageInfo( $title ) {
+       protected function pageInfo() {
                global $wgContLang, $wgDisableCounters, $wgRCMaxAge;
 
                $user = $this->getUser();