Don't use RequestContext::getMain() if a context is available

Change-Id: I2b16cf8f437ccda7cb0feb137710394e4a90d3b5
This commit is contained in:
Kunal Mehta 2014-08-12 22:54:51 -07:00
parent 3b277a7a28
commit 4b1a3eb059

View file

@ -140,7 +140,7 @@ class VisualEditorHooks {
* @returns boolean true * @returns boolean true
*/ */
public static function onEditPageShowEditFormFields( EditPage $editPage, OutputPage $output ) { public static function onEditPageShowEditFormFields( EditPage $editPage, OutputPage $output ) {
$request = RequestContext::getMain()->getRequest(); $request = $output->getRequest();
if ( $request->getBool( 'veswitched' ) ) { if ( $request->getBool( 'veswitched' ) ) {
$output->addHTML( Xml::input( 'veswitched', false, '1', array( 'type' => 'hidden' ) ) ); $output->addHTML( Xml::input( 'veswitched', false, '1', array( 'type' => 'hidden' ) ) );
} }