mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 17:52:45 +01:00
21 lines
390 B
Markdown
21 lines
390 B
Markdown
|
# TaintedUserSecret
|
|||
|
|
|||
|
Emitted when tainted input detection is turned on and data marked as a user secret is detected somewhere it shouldn’t be.
|
|||
|
|
|||
|
```php
|
|||
|
<?php
|
|||
|
|
|||
|
class User {
|
|||
|
/**
|
|||
|
* @psalm-taint-source user_secret
|
|||
|
*/
|
|||
|
public function getPassword() : string {
|
|||
|
return "$omePa$$word";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function showUserPassword(User $user) {
|
|||
|
echo $user->getPassword();
|
|||
|
}
|
|||
|
```
|