1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +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:
Lukas Reschke 2020-11-16 02:28:24 +01:00 committed by GitHub
parent 6f8b463860
commit fd06167843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);