X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUpload.php;h=c5a1f270735fa6793a3a1efcf86a346daa98a90d;hb=96491f80d3481190605006c71a8421857adda58e;hp=f7e46cb617f8a1be89ff66bf3b2342a78cd454bc;hpb=c8d361a38027ef5d808225b8a83f15417248aa67;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index f7e46cb617..c5a1f27073 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -209,7 +209,9 @@ class SpecialUpload extends SpecialPage { $this->processUpload(); } else { # Backwards compatibility hook - if ( !Hooks::run( 'UploadForm:initial', [ &$this ] ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $upload = $this; + if ( !Hooks::run( 'UploadForm:initial', [ &$upload ] ) ) { wfDebug( "Hook 'UploadForm:initial' broke output of the upload form\n" ); return; @@ -483,8 +485,9 @@ class SpecialUpload extends SpecialPage { return; } - - if ( !Hooks::run( 'UploadForm:BeforeProcessing', [ &$this ] ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $upload = $this; + if ( !Hooks::run( 'UploadForm:BeforeProcessing', [ &$upload ] ) ) { wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" ); // This code path is deprecated. If you want to break upload processing // do so by hooking into the appropriate hooks in UploadBase::verifyUpload @@ -570,7 +573,9 @@ class SpecialUpload extends SpecialPage { // Success, redirect to description page $this->mUploadSuccessful = true; - Hooks::run( 'SpecialUploadComplete', [ &$this ] ); + // Avoid PHP 7.1 warning of passing $this by reference + $upload = $this; + Hooks::run( 'SpecialUploadComplete', [ &$upload ] ); $this->getOutput()->redirect( $this->mLocalFile->getTitle()->getFullURL() ); } @@ -1085,12 +1090,14 @@ class UploadForm extends HTMLForm { global $wgContLang; $mto = $file->transform( [ 'width' => 120 ] ); - $this->addHeaderText( - '
' . - Html::element( 'img', [ - 'src' => $mto->getUrl(), - 'class' => 'thumbimage', - ] ) . '
', 'description' ); + if ( $mto ) { + $this->addHeaderText( + '
' . + Html::element( 'img', [ + 'src' => $mto->getUrl(), + 'class' => 'thumbimage', + ] ) . '
', 'description' ); + } } } @@ -1113,7 +1120,7 @@ class UploadForm extends HTMLForm { ? 'filereuploadsummary' : 'fileuploadsummary', 'default' => $this->mComment, - 'cols' => $this->getUser()->getIntOption( 'cols' ), + 'cols' => 80, 'rows' => 8, ] ];