From d016777a6a675da7f5f04a920c1a5ab8050a278e Mon Sep 17 00:00:00 2001 From: Phie Date: Fri, 8 Nov 2019 19:36:13 +0100 Subject: everything ending with sqd is a Note --- lib/Controller/NoteController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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']); -- cgit v1.2.3