{"record":{"id":"526304a423a9e313","repo":"getgrav/grav","slug":"filter-s-is-not-allowed","errorCode":null,"errorMessage":"Filter \"%s\" is not allowed.","messagePattern":"Filter \"(.+?)\" is not allowed\\.","errorType":"exception","errorClass":"SecurityNotAllowedFilterError","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php","lineNumber":71,"sourceCode":"    public function checkSecurity($tags, $filters, $functions, array $tests = []): void\n    {\n        if (null !== $this->allowedTests) {\n            foreach ($tests as $test) {\n                if (!in_array($test, $this->allowedTests, true)) {\n                    throw new SecurityNotAllowedTestError(sprintf('Test \"%s\" is not allowed.', $test), $test);\n                }\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        }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php#L53-L89","documentation":"Error \"Filter \"%s\" is not allowed.\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Common/Twig/Sandbox/GravSecurityPolicy.php:71 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"}