Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index c0c4895..f324eff 100644 (file)
@@ -1554,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;
 
@@ -1575,8 +1580,6 @@ class ApiMain extends ApiBase {
                        $this->setupExternalResponse( $module, $params );
                }
 
-               $this->checkAsserts( $params );
-
                // Execute
                $module->execute();
                Hooks::run( 'APIAfterExecute', [ &$module ] );