r76400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76399‎ | r76400 | r76401 >
Date:17:49, 9 November 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added display of error messages (like "You must be logged in to upload"), so that they appear instead of a blank page
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow2.php
@@ -119,10 +119,10 @@
120120 */
121121 public function execute( $par ) {
122122 global $wgUser, $wgOut, $wgRequest;
123 - // disable $wgOut - we'll print out the page manually, taking the
124 - // body created by the form, plus the necessary Javascript files,
125 - // and turning them into an HTML page
126 - $wgOut->disable();
 123+ // disable $wgOut - we'll print out the page manually, taking
 124+ // the body created by the form, plus the necessary Javascript
 125+ // files, and turning them into an HTML page
 126+ $wgOut->disable();
127127
128128 $this->setHeaders();
129129 $this->outputHeader();
@@ -130,6 +130,7 @@
131131 # Check uploading enabled
132132 if ( !UploadBase::isEnabled() ) {
133133 $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext' );
 134+ print $wgOut->getHTML();
134135 return;
135136 }
136137
@@ -143,18 +144,21 @@
144145 } else {
145146 $wgOut->permissionRequired( 'upload' );
146147 }
 148+ print $wgOut->getHTML();
147149 return;
148150 }
149151
150152 # Check blocks
151153 if ( $wgUser->isBlocked() ) {
152154 $wgOut->blockedPage();
 155+ print $wgOut->getHTML();
153156 return;
154157 }
155158
156159 # Check whether we actually want to allow changing stuff
157160 if ( wfReadOnly() ) {
158161 $wgOut->readOnlyPage();
 162+ print $wgOut->getHTML();
159163 return;
160164 }
161165

Status & tagging log