mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Array cast pass taints
This commit is contained in:
parent
73fb04fce7
commit
24137bdbad
@ -232,8 +232,7 @@ class CastAnalyzer
|
||||
$type = Type::getArray();
|
||||
}
|
||||
|
||||
if ($statements_analyzer->data_flow_graph instanceof \Psalm\Internal\Codebase\VariableUseGraph
|
||||
) {
|
||||
if ($statements_analyzer->data_flow_graph) {
|
||||
$type->parent_nodes = $stmt_expr_type->parent_nodes ?? [];
|
||||
}
|
||||
|
||||
|
@ -2182,6 +2182,16 @@ class TaintTest extends TestCase
|
||||
'error_message' => 'TaintedHtml',
|
||||
],
|
||||
*/
|
||||
'castToArrayPassTaints' => [
|
||||
'<?php
|
||||
$args = $_POST;
|
||||
|
||||
$args = (array) $args;
|
||||
|
||||
pg_query($connection, "SELECT * FROM tableA where key = " .$args["key"]);
|
||||
',
|
||||
'error_message' => 'TaintedSql',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user