Browse Source

delegate is_readable validation out of _realpath method

main
yggverse 7 months ago
parent
commit
c71c836dfa
  1. 13
      src/Model/Filesystem.php

13
src/Model/Filesystem.php

@ -42,6 +42,14 @@ class Filesystem @@ -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
if (str_contains($realpath, DIRECTORY_SEPARATOR . '.'))
{
@ -240,11 +248,6 @@ class Filesystem @@ -240,11 +248,6 @@ class Filesystem
return null;
}
if (!is_readable($realpath))
{
return null;
}
if (is_dir($realpath))
{
$realpath = rtrim(

Loading…
Cancel
Save