{"record":{"id":"a507fee07010d335","repo":"octobercms/october","slug":"calling-any-method-on-a-s-object-is-blocked-a507fe","errorCode":null,"errorMessage":"Calling any method on a \"%s\" object is blocked.","messagePattern":"Calling any method on a \"(.+?)\" object is blocked\\.","errorType":"exception","errorClass":"Twig\\Sandbox\\SecurityNotAllowedMethodError","httpStatus":null,"severity":"error","filePath":"modules/system/twig/SecurityPolicyLegacy.php","lineNumber":121,"sourceCode":"    public function checkMethodAllowed($obj, $method): void\n    {\n        if ($obj instanceof Template || $obj instanceof Markup) {\n            return;\n        }\n\n        $blockedMethod = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');\n\n        // Check objects\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 general classes\n        foreach ($this->blockedClasses as $blockedClass) {\n            if (is_a($obj, $blockedClass)) {\n                throw new SecurityNotAllowedMethodError(sprintf('Calling any method on a \"%s\" object is blocked.', $blockedClass), $blockedClass, $method);\n            }\n        }\n\n        // Check general methods\n        if (in_array($blockedMethod, $this->blockedMethods)) {\n            $class = get_class($obj);\n            throw new SecurityNotAllowedMethodError(sprintf('Calling \"%s\" method on a \"%s\" object is blocked.', $method, $class), $class, $method);\n        }\n    }\n\n    /**\n     * checkPropertyAllowed\n     * @throws SecurityNotAllowedPropertyError\n     */\n    public function checkPropertyAllowed($obj, $property): void\n    {\n        if (in_array($property, $this->blockedProperties)) {\n            $class = get_class($obj);","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/twig/SecurityPolicyLegacy.php#L103-L139","documentation":"Error \"Calling any method on a \"%s\" object is blocked.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/system/twig/SecurityPolicyLegacy.php:121 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"}