mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 14:38:47 +02:00
N°8017 - Security - dependabot - Symfony's VarDumper vulnerable to un… (#731)
Upgrade all Symfony components to last security fix (~6.4.0)
This commit is contained in:
@@ -31,9 +31,11 @@ class FileLocator implements FileLocatorInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|array
|
||||
* @return string|string[]
|
||||
*
|
||||
* @psalm-return ($first is true ? string : string[])
|
||||
*/
|
||||
public function locate(string $name, string $currentPath = null, bool $first = true)
|
||||
public function locate(string $name, ?string $currentPath = null, bool $first = true)
|
||||
{
|
||||
if ('' === $name) {
|
||||
throw new \InvalidArgumentException('An empty file name is not valid to be located.');
|
||||
@@ -84,7 +86,8 @@ class FileLocator implements FileLocatorInterface
|
||||
&& ':' === $file[1]
|
||||
&& ('\\' === $file[2] || '/' === $file[2])
|
||||
)
|
||||
|| null !== parse_url($file, \PHP_URL_SCHEME)
|
||||
|| parse_url($file, \PHP_URL_SCHEME)
|
||||
|| str_starts_with($file, 'phar:///') // "parse_url()" doesn't handle absolute phar path, despite being valid
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user