Permit __url__ and __href__ attribute usage in Genshi evaluation

Closes #14932
This commit is contained in:
Cédric Krier
2026-07-06 09:07:08 +02:00
parent 2743c2abaa
commit 4ddc5340b8
+2 -1
View File
@@ -10,7 +10,8 @@ class _SafeASTTransformer(ASTTransformer):
def visit_Attribute(self, node):
if (node.attr.startswith('_')
and node.attr not in {'__class__', '__name__'}):
and node.attr not in {
'__class__', '__name__', '__url__', '__href__'}):
raise ValueError(f"invalid attribute {node.attr!r}")
return super().visit_Attribute(node)