X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUpload.php;h=8b8e514ac0cc27fa2d2989f9100969069cc3178c;hb=0fa3413576751247586fe291c837fcedbba3c1f0;hp=4583305adc000c14776417c086c798b8d69552b8;hpb=e73e04c239cc1ef4aecf7e11d9f0cb723df2af99;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 4583305adc..8b8e514ac0 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() ); } @@ -588,7 +593,7 @@ class SpecialUpload extends SpecialPage { ) { if ( $config === null ) { wfDebug( __METHOD__ . ' called without a Config instance passed to it' ); - $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $config = MediaWikiServices::getInstance()->getMainConfig(); } $msg = []; @@ -1113,7 +1118,7 @@ class UploadForm extends HTMLForm { ? 'filereuploadsummary' : 'fileuploadsummary', 'default' => $this->mComment, - 'cols' => $this->getUser()->getIntOption( 'cols' ), + 'cols' => 80, 'rows' => 8, ] ];