X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FImagePage.php;h=b60b0108a11ca38b1f55e51bd047c769b0662bee;hb=bfce465c0f50332b717fe20882d7c617959ca386;hp=db3ec1416eeb062aa03c6ec97755d7f7ffb58a5f;hpb=6124d71e25c2894c3e025c20e81ff742045e8cd5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index db3ec1416e..b60b0108a1 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -69,6 +69,7 @@ class ImagePage extends Article { $this->fileLoaded = true; $this->displayImg = $img = false; + Hooks::run( 'ImagePageFindFile', [ $this, &$img, &$this->displayImg ] ); if ( !$img ) { // not set by hook? $img = wfFindFile( $this->getTitle() ); @@ -335,7 +336,10 @@ class ImagePage extends Article { $filename = wfEscapeWikiText( $this->displayImg->getName() ); $linktext = $filename; - Hooks::run( 'ImageOpenShowImageInlineBefore', [ &$this, &$out ] ); + // Use of &$this in hooks triggers warnings in PHP 7.1 + $imagePage = $this; + + Hooks::run( 'ImageOpenShowImageInlineBefore', [ &$imagePage, &$out ] ); if ( $this->displayImg->allowInlineDisplay() ) { # image