Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions t/ValuesAndExpressions/PreventSQLInjection.run
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,42 @@ my $sql = "select $var from " . method( $table ) . " where $where"; ## SQL safe

my $sql = "select * from " . Acme::XYZ::method($table);

## name Anonimous functions without arguments
## failures 0
## cut

my $sql = "select from " . $x->(); ## SQL safe ($x)

## name Anonimous functions with arguments
## failures 0
## cut

my $sql = "select from " . $x->( $y ); ## SQL safe ($x)

## name Anonimous functions without arguments - another syntax
## failures 0
## cut

my $sql = "select from " . &$x; ## SQL safe ($x)

## name Anonimous functions with arguments - another syntax
## failures 0
## cut

my $sql = "select from " . &$x($y); ## SQL safe ($x)

## name Functions returning anonimous functions without SQL safe
## failures 1
## cut

my $sql = "select from " . iterator->();

## name Functions returning anonimous functions with SQL safe
## failures 0
## cut

my $sql = "select from " . iterator->(); ## SQL safe (&iterator)

## name Prohibit all quoting methods.
## parms { quoting_methods => '' }
## failures 1
Expand Down