{"record":{"id":"0d55ab5b7f4de8a1","repo":"getgrav/grav","slug":"function-s-is-not-allowed","errorCode":null,"errorMessage":"Function \"%s\" is not allowed.","messagePattern":"Function \"(.+?)\" is not allowed\\.","errorType":"exception","errorClass":"SecurityNotAllowedFunctionError","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php","lineNumber":77,"sourceCode":"                }\n            }\n        }\n\n        foreach ($tags as $tag) {\n            if (!in_array($tag, $this->allowedTags, true)) {\n                throw new SecurityNotAllowedTagError(sprintf('Tag \"%s\" is not allowed.', $tag), $tag);\n            }\n        }\n\n        foreach ($filters as $filter) {\n            if (!in_array($filter, $this->allowedFilters, true)) {\n                throw new SecurityNotAllowedFilterError(sprintf('Filter \"%s\" is not allowed.', $filter), $filter);\n            }\n        }\n\n        foreach ($functions as $function) {\n            if (!in_array($function, $this->allowedFunctions, true)) {\n                throw new SecurityNotAllowedFunctionError(sprintf('Function \"%s\" is not allowed.', $function), $function);\n            }\n        }\n    }\n\n    public function checkMethodAllowed($obj, $method): void\n    {\n        $method = strtolower($method);\n        foreach ($this->allowedMethods as $class => $methods) {\n            if ($obj instanceof $class && (in_array('*', $methods, true) || in_array($method, $methods, true))) {\n                return;\n            }\n        }\n\n        $class = $obj::class;\n        throw new SecurityNotAllowedMethodError(\n            sprintf('Calling \"%s\" method on a \"%s\" object is not allowed.', $method, $class),\n            $class,\n            $method","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php#L59-L95","documentation":"Error \"Function \"%s\" is not allowed.\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php:77 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":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}