Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ sub get_complete_variable {
$is_quoted = 1;
last;
}
elsif ($sibling->isa('PPI::Token::Word')
&& $sibling->method_call()
# allow for stacking method calls, e.g. $foo->bar->baz->dbh->quote
$variable .= $sibling->content();
else {
last;
}
Expand Down
6 changes: 6 additions & 0 deletions t/ValuesAndExpressions/PreventSQLInjection.run
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ $sql = "UPDATE table_name SET field = " . $dbh->test($value) . "WHERE field = 1"

$sql = "UPDATE table_name SET field = " . $dbh->test($value) . "WHERE field = " . $dbh->quote($value2);

## name Allow stacked calls prior to quoting method
## parms { quoting_methods => 'test' }
## failures 0
## cut

$sql = "UPDATE table_name SET field = " . $foo->bar->baz->dbh->test($value) . "WHERE field = 1";

## name vars in subtest name.
## parms { prefer_upper_case_keywords => 0 }
Expand Down