Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2995b02

Browse files
committed
Python: Fix handling of turbogears' 'expose' decorator.
1 parent 3854050 commit 2995b02

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

python/ql/src/semmle/python/web/turbogears/TurboGears.qll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ class TurboGearsControllerMethod extends Function {
1919
TurboGearsControllerMethod() {
2020
aTurboGearsControllerClass().getPyClass() = this.getScope() and
2121
decorator = this.getADecorator().getAFlowNode() and
22-
/* Is decorated with @expose or @expose(path) */
22+
/* Is decorated with @expose() or @expose(path) */
2323
(
24-
decorator.(NameNode).getId() = "expose"
25-
or
2624
decorator.(CallNode).getFunction().(NameNode).getId() = "expose"
2725
or
28-
decorator.refersTo(ModuleObject::named("tg").getAttribute("expose"))
29-
or
3026
decorator.refersTo(_, ModuleObject::named("tg").getAttribute("expose"), _)
3127
)
3228
}

0 commit comments

Comments
 (0)