Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 914d8e9..f324eff 100644 (file)
@@ -1258,6 +1258,8 @@ class ApiMain extends ApiBase {
                        }
                }
 
+               Hooks::runWithoutAbort( 'ApiMaxLagInfo', [ &$lagInfo ] );
+
                return $lagInfo;
        }
 
@@ -1552,6 +1554,11 @@ class ApiMain extends ApiBase {
         */
        protected function executeAction() {
                $params = $this->setupExecuteAction();
+
+               // Check asserts early so e.g. errors in parsing a module's parameters due to being
+               // logged out don't override the client's intended "am I logged in?" check.
+               $this->checkAsserts( $params );
+
                $module = $this->setupModule();
                $this->mModule = $module;
 
@@ -1573,8 +1580,6 @@ class ApiMain extends ApiBase {
                        $this->setupExternalResponse( $module, $params );
                }
 
-               $this->checkAsserts( $params );
-
                // Execute
                $module->execute();
                Hooks::run( 'APIAfterExecute', [ &$module ] );