Merge "Revert "Use display name in category page subheadings if provided""
[lhc/web/wiklou.git] / includes / AjaxDispatcher.php
index 96892d7..d444a27 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:
@@ -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 {
                                }
                        }
                }
-
        }
 }