Fix realppath not working when does not exist
This commit is contained in:
parent
5eae25fec6
commit
15487b57f2
7
base.php
7
base.php
|
@ -177,7 +177,12 @@ function filedb_exists($ns, $file=''){ return file_exists(filedb_getdir($ns,$fil
|
|||
function filedb_getdir($ns, $file='') {
|
||||
$dir = $GLOBALS['appconf']['data_dir'];
|
||||
$ns = trim($ns, '/');
|
||||
$dir = realpath($dir.'/'.$ns);
|
||||
$_ = realpath($dir.'/'.$ns);
|
||||
if ($_ === false) {
|
||||
mkdir($dir.'/'.$ns);
|
||||
$_ = realpath($dir.'/'.$ns);
|
||||
}
|
||||
$dir = $_;
|
||||
if (strpos($dir, $GLOBALS['appconf']['data_dir']) === false)
|
||||
return false;
|
||||
return $dir.'/'.$file;
|
||||
|
|
Loading…
Reference in New Issue