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.
try {
$this->checkMaxLag( true );
$this->main();
- $this->finalCleanup();
$this->restInPeace();
} catch ( Exception $e ) {
MWExceptionHandler::handle( $e );
# 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' ) {
}
$this->performRequest();
+ $this->finalCleanup();
wfProfileOut( __METHOD__ );
}