Skip to content

test cases related to anonimous functions #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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