Permit __url__ and __href__ attribute usage in Genshi evaluation
Closes #14932 (grafted from 936431c951bb4eb9d17c399445c6cacf7dcb8626) --HG-- branch : 8.0
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user