Permit __url__ and __href__ attribute usage in Genshi evaluation

Closes #14932
(grafted from 936431c951bb4eb9d17c399445c6cacf7dcb8626)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-07-06 09:07:08 +02:00
parent 945099dc67
commit 402c9fa20b
+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)