Exit from AJAX requests properly. Calling exit after doing something is really bad.
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 24 Aug 2006 17:01:45 +0000 (17:01 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 24 Aug 2006 17:01:45 +0000 (17:01 +0000)
includes/AjaxDispatcher.php
index.php

index 2084c36..2704e27 100644 (file)
@@ -60,7 +60,7 @@ class AjaxDispatcher {
        }
 
        function performAction() {
-               global $wgAjaxCachePolicy, $wgAjaxExportList;
+               global $wgAjaxCachePolicy, $wgAjaxExportList, $wgOut;
                if ( empty( $this->mode ) ) {
                        return;
                }
@@ -76,7 +76,7 @@ class AjaxDispatcher {
                        echo $result;
                }
                wfProfileOut( 'AjaxDispatcher::performAction' );
-               exit;
+               $wgOut = null;
        }
 }
 
index bd5ffab..964770e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -22,7 +22,7 @@ if ( $wgUseAjax && $action == 'ajax' ) {
 
        $dispatcher = new AjaxDispatcher();
        $dispatcher->performAction();
-
+       $mediaWiki->restInPeace( $wgLoadBalancer );
        exit;
 }