mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
$expr->name is not prefixed with $ (#4554)
The example as-is would currently not flag the following code: ``` public function foo() { $foo = $bad_data; \shell_exec($foo); } ``` Switching it to `bad_data` made it work.
This commit is contained in:
parent
2f368244a4
commit
7079cff31c
@ -53,7 +53,7 @@ class BadSqlTainter implements AfterExpressionAnalysisInterface
|
||||
array &$file_replacements = []
|
||||
) {
|
||||
if ($expr instanceof PhpParser\Node\Expr\Variable
|
||||
&& $expr->name === '$bad_data'
|
||||
&& $expr->name === 'bad_data'
|
||||
) {
|
||||
$expr_type = $statements_source->getNodeTypeProvider()->getType($expr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user