From 4fe87edd1d4ca348395b0ae77f6947cd3ee2728f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 9 Mar 2026 20:29:18 +0900 Subject: [PATCH] Don't call API class if HTTP status code is 4xx or 5xx --- classes/module/ModuleObject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index e2ede1a5b..687c07bad 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -921,7 +921,7 @@ class ModuleObject extends BaseObject // execute api methods of the module if view action is and result is XMLRPC or JSON if(isset($this->module_info->module_type) && in_array($this->module_info->module_type, ['view', 'mobile'])) { - if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') + if ($this->getHttpStatusCode() < 400 && in_array(Context::getResponseMethod(), ['JSON', 'XMLRPC'])) { $oAPI = getAPI($this->module_info->module); if($oAPI instanceof ModuleObject && method_exists($oAPI, $this->act))