-
Notifications
You must be signed in to change notification settings - Fork 672
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
TaintedSql false positives for prepared PDO statements #10047
Comments
Hey @cgocast, can you reproduce the issue on https://psalm.dev ? |
function deleteConcatenedUserId(PDO $pdo): void {
$userId = $_POST['userid'];
$stmt = $pdo->prepare("delete from users where user_id = " . $userId);
$stmt->execute();
} This code should very much raise a TaintedSql issue :) The first one however shouldn't, correct. |
@danog Both code are very similar. I do not understand why the second one should raises a TaintedSql while the second should not. Please, can you give me a more detailed explanation ? |
Psalm is simply warning about the fact that using |
|
This was fixed by PR #10048 |
The PHP documentation for PDO::prepare() states
Therefore, the following code sample should not raise TaintedSql:
The text was updated successfully, but these errors were encountered: