From 0a160b3a86a6e6381cfdcd53e03e37fefaff4e1e Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 9 Apr 2015 09:21:33 +0200 Subject: [PATCH] Set context earlier in UploadForm::__construct The parent constructor sets the $context for the form, but getSourceSection is using getUser before the call, which results in a warning for using RequestContext::getMain(). Just set the context before use. Change-Id: I88af41b22cf05ce18d3d2852325bc97cd2544556 --- includes/specials/SpecialUpload.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 6f9254bad1..8390feb083 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -787,6 +787,7 @@ class UploadForm extends HTMLForm { protected $mMaxUploadSize = array(); public function __construct( array $options = array(), IContextSource $context = null ) { + $this->setContext( $context ); $this->mWatch = !empty( $options['watch'] ); $this->mForReUpload = !empty( $options['forreupload'] ); $this->mSessionKey = isset( $options['sessionkey'] ) ? $options['sessionkey'] : ''; -- 2.20.1