mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Merge pull request #10154 from cgocast/5.x
This commit is contained in:
commit
77436b1339
@ -15,6 +15,7 @@ class ReflectionClass implements Reflector {
|
||||
/**
|
||||
* @param T|class-string<T>|interface-string<T>|trait-string|enum-string<T> $argument
|
||||
* @psalm-pure
|
||||
* @psalm-taint-sink callable $argument
|
||||
*/
|
||||
public function __construct($argument) {}
|
||||
|
||||
@ -424,7 +425,7 @@ class ReflectionFunction extends ReflectionFunctionAbstract
|
||||
{
|
||||
/**
|
||||
* @param callable-string|Closure $function
|
||||
*
|
||||
* @psalm-taint-sink callable $function
|
||||
* @psalm-pure
|
||||
*/
|
||||
public function __construct(callable $function) {}
|
||||
|
@ -2489,6 +2489,20 @@ class TaintTest extends TestCase
|
||||
echo pg_escape_string($conn, $_GET["a"]);',
|
||||
'error_message' => 'TaintedHtml',
|
||||
],
|
||||
'taintedReflectionClass' => [
|
||||
'code' => '<?php
|
||||
$name = $_GET["name"];
|
||||
$reflector = new ReflectionClass($name);
|
||||
$reflector->newInstance();',
|
||||
'error_message' => 'TaintedCallable',
|
||||
],
|
||||
'taintedReflectionFunction' => [
|
||||
'code' => '<?php
|
||||
$name = $_GET["name"];
|
||||
$function = new ReflectionFunction($name);
|
||||
$function->invoke();',
|
||||
'error_message' => 'TaintedCallable',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user