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.
This commit is contained in:
Matěj Grabovský 2011-06-18 21:13:46 +00:00
parent 94035c764f
commit fa5ca6db3d

View file

@ -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__ );
}