From fa5ca6db3dac03ba13eea07e17b59525b322bd63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= Date: Sat, 18 Jun 2011 21:13:46 +0000 Subject: [PATCH] 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. --- includes/Wiki.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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__ ); } -- 2.20.1