Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -547,20 +547,28 @@ |
548 | 548 | |
549 | 549 | wfProfileIn( __METHOD__ ); |
550 | 550 | |
551 | | - // Get title from request parameters, |
552 | | - // is set on the fly by parseTitle the first time. |
553 | | - $title = $this->getTitle(); |
554 | | - $action = $this->getAction(); |
555 | | - $wgTitle = $title; |
| 551 | + $request = $this->context->getRequest(); |
556 | 552 | |
557 | 553 | // Send Ajax requests to the Ajax dispatcher. |
558 | | - if ( $wgUseAjax && true ) { |
| 554 | + if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) { |
| 555 | + |
| 556 | + // Set a dummy title, because $wgTitle == null might break things |
| 557 | + $title = Title::makeTitle( NS_MAIN, 'AJAX' ); |
| 558 | + $this->context->setTitle( $title ); |
| 559 | + $wgTitle = $title; |
| 560 | + |
559 | 561 | $dispatcher = new AjaxDispatcher(); |
560 | 562 | $dispatcher->performAction(); |
561 | 563 | wfProfileOut( __METHOD__ ); |
562 | 564 | return; |
563 | 565 | } |
564 | 566 | |
| 567 | + // Get title from request parameters, |
| 568 | + // is set on the fly by parseTitle the first time. |
| 569 | + $title = $this->getTitle(); |
| 570 | + $action = $this->getAction(); |
| 571 | + $wgTitle = $title; |
| 572 | + |
565 | 573 | if ( $wgUseFileCache && $title->getNamespace() >= 0 ) { |
566 | 574 | wfProfileIn( 'main-try-filecache' ); |
567 | 575 | if ( HTMLFileCache::useFileCache( $this->context ) ) { |