mirror of
https://github.com/YGGverse/next.git
synced 2026-04-01 18:25:29 +00:00
delegate is_readable validation out of _realpath method
This commit is contained in:
parent
6de4d593b0
commit
c71c836dfa
1 changed files with 8 additions and 5 deletions
|
|
@ -42,6 +42,14 @@ class Filesystem
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Root is readable
|
||||||
|
if (!is_readable($realpath))
|
||||||
|
{
|
||||||
|
throw new \Exception(
|
||||||
|
_('root path is not readable!')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Check root path does not contain hidden context
|
// Check root path does not contain hidden context
|
||||||
if (str_contains($realpath, DIRECTORY_SEPARATOR . '.'))
|
if (str_contains($realpath, DIRECTORY_SEPARATOR . '.'))
|
||||||
{
|
{
|
||||||
|
|
@ -240,11 +248,6 @@ class Filesystem
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_readable($realpath))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_dir($realpath))
|
if (is_dir($realpath))
|
||||||
{
|
{
|
||||||
$realpath = rtrim(
|
$realpath = rtrim(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue