Merge "Move up devunt's name to Developers"
[lhc/web/wiklou.git] / includes / AjaxDispatcher.php
index 96892d7..9142238 100644 (file)
@@ -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:
@@ -135,6 +135,9 @@ class AjaxDispatcher {
                                                $result = new AjaxResponse( $result );
                                        }
 
+                                       // Make sure DB commit succeeds before sending a response
+                                       wfGetLBFactory()->commitMasterChanges( __METHOD__ );
+
                                        $result->sendHeaders();
                                        $result->printText();