@@ -20,10 +20,9 @@ abstract class ActionMethod extends Method {
20
20
str =
21
21
this .getADescription ( )
22
22
// separate camelCase words
23
- .regexpReplaceAll ( "([a-z])([A-Z])" , "$1_$2" )
24
- .toLowerCase ( ) and
25
- str .regexpMatch ( ".*(edit|delete|modify|change).*" ) and
26
- not str .regexpMatch ( ".*(on_?change|changed).*" )
23
+ .regexpReplaceAll ( "([a-z])([A-Z])" , "$1_$2" ) and
24
+ str .regexpMatch ( "(?i).*(edit|delete|modify|change).*" ) and
25
+ not str .regexpMatch ( "(?i).*(on_?change|changed).*" )
27
26
)
28
27
}
29
28
@@ -32,13 +31,9 @@ abstract class ActionMethod extends Method {
32
31
this .getADescription ( )
33
32
// separate camelCase words
34
33
.regexpReplaceAll ( "([a-z])([A-Z])" , "$1_$2" )
35
- .toLowerCase ( )
36
- .regexpMatch ( ".*(admin|superuser).*" )
34
+ .regexpMatch ( "(?i).*(admin|superuser).*" )
37
35
}
38
36
39
- /** Holds if this method may need an authorization check. */
40
- predicate needsAuth ( ) { this .isEdit ( ) or this .isAdmin ( ) }
41
-
42
37
/** Gets a callable for which if it contains an auth check, this method should be considered authenticated. */
43
38
Callable getAnAuthorizingCallable ( ) { result = this }
44
39
@@ -64,8 +59,7 @@ private class WebFormActionMethod extends ActionMethod {
64
59
override Callable getAnAuthorizingCallable ( ) {
65
60
result = super .getAnAuthorizingCallable ( )
66
61
or
67
- result .getDeclaringType ( ) = this .getDeclaringType ( ) and
68
- result .getName ( ) = "Page_Load"
62
+ pageLoad ( result , this .getDeclaringType ( ) )
69
63
}
70
64
71
65
override string getARoute ( ) {
@@ -80,6 +74,12 @@ private class WebFormActionMethod extends ActionMethod {
80
74
}
81
75
}
82
76
77
+ pragma [ nomagic]
78
+ private predicate pageLoad ( Callable c , Type decl ) {
79
+ c .getName ( ) = "Page_Load" and
80
+ decl = c .getDeclaringType ( )
81
+ }
82
+
83
83
/**
84
84
* Holds if `virtualRoute` is a URL path
85
85
* that can map to the corresponding `physicalRoute` filepath
0 commit comments