X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FAjaxDispatcher.php;h=d444a2791f36413527febbd2fcea7e1625478849;hb=5f11f7818c3e3f82245ce92aa699e08fa086b70a;hp=96892d710f9e81de1f67bc18fefb0b858c8834b7;hpb=4f21e6be661f7305abc223bb31600970a3fb5326;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 96892d710f..d444a2791f 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -74,7 +74,7 @@ class AjaxDispatcher { if ( !empty( $_GET["rsargs"] ) ) { $this->args = $_GET["rsargs"]; } else { - $this->args = array(); + $this->args = []; } break; case 'post': @@ -82,7 +82,7 @@ class AjaxDispatcher { if ( !empty( $_POST["rsargs"] ) ) { $this->args = $_POST["rsargs"]; } else { - $this->args = array(); + $this->args = []; } break; default: @@ -90,7 +90,6 @@ class AjaxDispatcher { # Or we could throw an exception: # throw new MWException( __METHOD__ . ' called without any data (mode empty).' ); } - } /** @@ -135,6 +134,9 @@ class AjaxDispatcher { $result = new AjaxResponse( $result ); } + // Make sure DB commit succeeds before sending a response + wfGetLBFactory()->commitMasterChanges( __METHOD__ ); + $result->sendHeaders(); $result->printText(); @@ -153,6 +155,5 @@ class AjaxDispatcher { } } } - } }