From: Matěj Grabovský Date: Sat, 18 Jun 2011 21:13:46 +0000 (+0000) Subject: Fix outputting AJAX X-Git-Tag: 1.31.0-rc.0~29429 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=fa5ca6db3dac03ba13eea07e17b59525b322bd63;p=lhc%2Fweb%2Fwiklou.git Fix outputting AJAX When calling remote functions, MW was outputting the result followed by page HTML. This was caused by calling the cleanup function, which also output the HTML, even after an AJAX request. Fixed by moving the call after AJAX is all safely handled. --- diff --git a/includes/Wiki.php b/includes/Wiki.php index dafae673fb..f3d1c6d6db 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -494,7 +494,6 @@ class MediaWiki { try { $this->checkMaxLag( true ); $this->main(); - $this->finalCleanup(); $this->restInPeace(); } catch ( Exception $e ) { MWExceptionHandler::handle( $e ); @@ -548,7 +547,7 @@ class MediaWiki { # Set title from request parameters $wgTitle = $this->getTitle(); - $action = $this->context->getRequest()->getVal( 'action', 'view' ); + $action = $this->getAction(); # Send Ajax requests to the Ajax dispatcher. if ( $wgUseAjax && $action == 'ajax' ) { @@ -584,6 +583,7 @@ class MediaWiki { } $this->performRequest(); + $this->finalCleanup(); wfProfileOut( __METHOD__ ); }