wfProfileIn( __METHOD__ );
- // Get title from request parameters,
- // is set on the fly by parseTitle the first time.
- $title = $this->getTitle();
- $action = $this->getAction();
- $wgTitle = $title;
+ $request = $this->context->getRequest();
// Send Ajax requests to the Ajax dispatcher.
- if ( $wgUseAjax && true ) {
+ if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) {
+
+ // Set a dummy title, because $wgTitle == null might break things
+ $title = Title::makeTitle( NS_MAIN, 'AJAX' );
+ $this->context->setTitle( $title );
+ $wgTitle = $title;
+
$dispatcher = new AjaxDispatcher();
$dispatcher->performAction();
wfProfileOut( __METHOD__ );
return;
}
+ // Get title from request parameters,
+ // is set on the fly by parseTitle the first time.
+ $title = $this->getTitle();
+ $action = $this->getAction();
+ $wgTitle = $title;
+
if ( $wgUseFileCache && $title->getNamespace() >= 0 ) {
wfProfileIn( 'main-try-filecache' );
if ( HTMLFileCache::useFileCache( $this->context ) ) {