Skip to content

Commit

Permalink
If in pattern is node with one argument -- don't split
Browse files Browse the repository at this point in the history
  • Loading branch information
LTe committed Jun 8, 2012
1 parent a2412a2 commit b945d14
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
33 changes: 13 additions & 20 deletions lib/scanny/checks/xss/xss_flash_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ def pattern_params
SymbolLiteral<value = :warning>,
SendWithArguments<
name = :[],
receiver = Send<
name = :params>
receiver = Send<name = :params>
>
]
>,
name = :[]=,
receiver = Send<
name = :flash
>
receiver = Send<name = :flash>
>
EOT
end
Expand All @@ -52,23 +49,19 @@ def pattern_dynamic_string
<<-EOT
ElementAssignment<
arguments = ActualArguments<
array = [
SymbolLiteral<
value = :warning
>,
DynamicString<
array = [
ToString<
value = Send<name = any>
>
]
>
]
array = [
SymbolLiteral<value = :warning>,
DynamicString<
array = [
ToString<
value = Send<name = any>
>
]
>
]
>,
name = :[]=,
receiver = Send<
name = :flash
>
receiver = Send<name = :flash>
>
EOT
end
Expand Down
4 changes: 1 addition & 3 deletions lib/scanny/checks/xss/xss_logger_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def pattern_params
array = [
SendWithArguments<
name = :[],
receiver = Send<
name = :params
>
receiver = Send<name = :params>
>
]
>,
Expand Down
4 changes: 1 addition & 3 deletions lib/scanny/checks/xss/xss_mark_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def warning_message
#info CWE-000 (mark_as_xss_protected|mark_methods_as_xss_safe)
def pattern_mark_as
<<-EOT
Send<
name = :mark_as_xss_protected | :mark_methods_as_xss_safe
>
Send<name = :mark_as_xss_protected | :mark_methods_as_xss_safe>
EOT
end
end
Expand Down

0 comments on commit b945d14

Please sign in to comment.