{"record":{"id":"c2c25ff7e288dd82","repo":"octobercms/october","slug":"calling-s-method-on-a-s-object-is-blocked","errorCode":null,"errorMessage":"Calling \"%s\" method on a \"%s\" object is blocked.","messagePattern":"Calling \"(.+?)\" method on a \"(.+?)\" object is blocked\\.","errorType":"exception","errorClass":"Twig\\Sandbox\\SecurityNotAllowedMethodError","httpStatus":null,"severity":"error","filePath":"modules/system/twig/SecurityPolicy.php","lineNumber":263,"sourceCode":"        $className = get_class($obj);\n        throw new SecurityNotAllowedMethodError(sprintf('Calling any method on a \"%s\" object is blocked.', $className), $className, $method);\n    }\n\n    //\n    // Block-list\n    //\n\n    /**\n     * checkMethodAllowedBlocklist\n     */\n    protected function checkMethodAllowedBlocklist($obj, $method)\n    {\n        $blockedMethod = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');\n\n        // Check direct class blocklists\n        foreach ($this->blockedClassMethods as $blockedClass => $blockedMethods) {\n            if (is_a($obj, $blockedClass) && in_array($blockedMethod, $blockedMethods)) {\n                throw new SecurityNotAllowedMethodError(sprintf('Calling \"%s\" method on a \"%s\" object is blocked.', $method, $blockedClass), $blockedClass, $method);\n            }\n        }\n\n        // Check forwarder chains: if $obj's class forwards __call to another\n        // class, enforce that class's blocklist as well (transitively).\n        foreach ($this->blockedClassForwarders as $sourceClass => $targetClass) {\n            if (!is_a($obj, $sourceClass)) {\n                continue;\n            }\n\n            $cursor = $targetClass;\n            while ($cursor !== null) {\n                $targetMethods = $this->blockedClassMethods[$cursor] ?? [];\n                if (in_array($blockedMethod, $targetMethods)) {\n                    throw new SecurityNotAllowedMethodError(sprintf('Calling \"%s\" method on a \"%s\" object is blocked.', $method, $sourceClass), $sourceClass, $method);\n                }\n                $cursor = $this->blockedClassForwarders[$cursor] ?? null;\n            }","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/twig/SecurityPolicy.php#L245-L281","documentation":"Error \"Calling \"%s\" method on a \"%s\" object is blocked.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/system/twig/SecurityPolicy.php:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}