file: glob remove the first char if there is no chroot
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3757 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
14
file.php
14
file.php
@@ -257,10 +257,18 @@ class file
|
||||
throw new \Exception ("Glob : can't read some files", 500);
|
||||
foreach ($files as &$file)
|
||||
{
|
||||
if ($relative == 1)
|
||||
$file = substr ($file, strlen ($this->baseDir)+strlen ($this->cwd)+1);
|
||||
if (strlen ($this->baseDir) > 1)
|
||||
{
|
||||
if ($relative == 1)
|
||||
$file = substr ($file, strlen ($this->baseDir)+strlen ($this->cwd)+1);
|
||||
else
|
||||
$file = substr ($file, strlen ($this->baseDir));
|
||||
}
|
||||
else
|
||||
$file = substr ($file, strlen ($this->baseDir));
|
||||
{
|
||||
if ($relative == 1)
|
||||
$file = substr ($file, strlen ($this->cwd)+1);
|
||||
}
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user