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;
}
* @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' );
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;
}
$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
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 );
if ( $row->page_is_redirect ) {
if ( $level < 2 ) {
- $this->showIndirectLinks( $level + 1, $nt, 500 );
+ $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved );
}
}
$wgOut->addHTML( "</li>\n" );