Update to r32375 / bug 11874 -- !important may have whitespace between ! and important
[lhc/web/wiklou.git] / includes / SpecialWhatlinkshere.php
index b0ae19c..56b977e 100644 (file)
@@ -25,9 +25,9 @@ class WhatLinksHerePage {
 
        private $namespace;
 
-       function WhatLinksHerePage( &$request, $par = null ) {
+       function WhatLinksHerePage( $request, $par = null ) {
                global $wgUser;
-               $this->request =& $request;
+               $this->request = $request;
                $this->skin = $wgUser->getSkin();
                $this->par = $par;
        }
@@ -74,9 +74,9 @@ class WhatLinksHerePage {
         * @private
         */
        function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
-               global $wgOut;
+               global $wgOut, $wgMaxRedirectLinksRetrieved;
                $fname = 'WhatLinksHerePage::showIndirectLinks';
-               $dbr = wfGetDB( DB_READ );
+               $dbr = wfGetDB( DB_SLAVE );
                $options = array();
 
                $ns = $this->request->getIntOrNull( 'namespace' );
@@ -138,7 +138,7 @@ class WhatLinksHerePage {
                                list( $options['limit'], $options['offset']) = wfCheckLimits();
                                $wgOut->addHTML( $this->whatlinkshereForm( $options ) );
                                $errMsg = isset( $this->namespace ) ? 'nolinkshere-ns' : 'nolinkshere';
-                               $wgOut->addWikiText( wfMsg( $errMsg, $this->target->getPrefixedText() ) );
+                               $wgOut->addWikiMsg( $errMsg, $this->target->getPrefixedText() );
                        }
                        return;
                }
@@ -155,7 +155,7 @@ class WhatLinksHerePage {
                $options['offset'] = $this->request->getVal( 'offset' );
                /* Offset must be an integral. */
                if ( !strlen( $options['offset'] ) || !preg_match( '/^[0-9]+$/', $options['offset'] ) )
-               $options['offset'] = '';
+                       $options['offset'] = '';
                $options['target'] = $this->target->getPrefixedText();
 
                // Read the rows into an array and remove duplicates
@@ -193,7 +193,7 @@ class WhatLinksHerePage {
 
                if ( $level == 0 ) {
                        $wgOut->addHTML( $this->whatlinkshereForm( $options ) );
-                       $wgOut->addWikiText( wfMsg( 'linkshere', $this->target->getPrefixedText() ) );
+                       $wgOut->addWikiMsg( 'linkshere', $this->target->getPrefixedText() );
 
                        $prevnext = $this->getPrevNext( $limit, $prevId, $nextId, $options['namespace'] );
                        $wgOut->addHTML( $prevnext );
@@ -235,7 +235,7 @@ class WhatLinksHerePage {
                        
                        if ( $row->page_is_redirect ) {
                                if ( $level < 2 ) {
-                                       $this->showIndirectLinks( $level + 1, $nt, 500 );
+                                       $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved );
                                }
                        }
                        $wgOut->addHTML( "</li>\n" );