return false;
}
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $block = $this;
# Allow hooks to cancel the autoblock.
- if ( !Hooks::run( 'AbortAutoblock', [ $autoblockIP, &$this ] ) ) {
+ if ( !Hooks::run( 'AbortAutoblock', [ $autoblockIP, &$block ] ) ) {
wfDebug( "Autoblock aborted by hook.\n" );
return false;
}
}
}
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $outputPage = $this;
# Add the remaining categories to the skin
if ( Hooks::run(
'OutputPageMakeCategoryLinks',
- [ &$this, $categories, &$this->mCategoryLinks ] )
+ [ &$outputPage, $categories, &$this->mCategoryLinks ] )
) {
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
foreach ( $categories as $category => $type ) {
// Link flags are ignored for now, but may in the future be
// used to mark individual language links.
$linkFlags = [];
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $outputPage = $this;
Hooks::run( 'LanguageLinks', [ $this->getTitle(), &$this->mLanguageLinks, &$linkFlags ] );
- Hooks::run( 'OutputPageParserOutput', [ &$this, $parserOutput ] );
+ Hooks::run( 'OutputPageParserOutput', [ &$outputPage, $parserOutput ] );
}
/**
*/
public function addParserOutputText( $parserOutput ) {
$text = $parserOutput->getText();
- Hooks::run( 'OutputPageBeforeHTML', [ &$this, &$text ] );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $outputPage = $this;
+ Hooks::run( 'OutputPageBeforeHTML', [ &$outputPage, &$text ] );
$this->addHTML( $text );
}
}
MWDebug::addModules( $this );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $outputPage = $this;
// Hook that allows last minute changes to the output page, e.g.
// adding of CSS or Javascript by extensions.
- Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] );
+ Hooks::run( 'BeforePageDisplay', [ &$outputPage, &$sk ] );
try {
$sk->outputPage();