diff options
author | Phie <phie@phie.ovh> | 2019-11-08 21:36:13 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-11-08 21:36:13 +0300 |
commit | d016777a6a675da7f5f04a920c1a5ab8050a278e (patch) | |
tree | 63751347018324f6c5439aa5a53de01ac8ab7f69 /lib | |
parent | 8e2288aa64941369a901160ecc722de1d24fc9c1 (diff) |
everything ending with sqd is a Note
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Controller/NoteController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index b24f686..c0bd031 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -51,7 +51,7 @@ public function isNote($node){ - return $node->getType() !== "dir" || substr($node->getName(), 0, strlen("note$")) === "note$"; + return $node->getType() !== "dir" || substr($node->getName(), strlen($node->getName()) -strlen(".sqd"),strlen($node->getName())) === ".sqd"; } /** * CAUTION: the @Stuff turns off security checks; for this page no admin is @@ -71,12 +71,12 @@ $paths = array(); $data = array(); foreach($this->CarnetFolder->get($path)->getDirectoryListing() as $in){ - + $inf = $in->getFileInfo(); $file = array(); $file['name'] = $inf->getName(); $file['path'] = $path.$inf->getName(); - $file['isDir'] = !$this->isNote($inf); + $file['isDir'] = $inf->getType() === "dir"; $file['mtime'] = $inf->getMtime(); if($inf->getType() !== "dir"){ array_push($paths, $file['path']); |