From e027e1f4082db027e2bea7b050d0e62f5b8e1c34 Mon Sep 17 00:00:00 2001 From: Phie Date: Wed, 4 Nov 2020 23:19:45 +0100 Subject: fix stuffs --- lib/Controller/NoteController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index 776e2f5..a14a410 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -1386,11 +1386,11 @@ public function getOpusEncoder(){ if($i>0){ $curprefix = substr($f, 0, $i); - if($prefix == "") + if($prefix == "") $prefix = $curprefix; - if($curprefix != $prefix){ + else if($curprefix != $prefix){ $prefix = Null; - + break; } } @@ -1409,7 +1409,7 @@ public function getOpusEncoder(){ if($relativePath == "") continue; - if(endsWith($relativePath, ".sqd") ){ + if(endsWith($relativePath, ".sqd") ){ $newPath = $relativePath; if($this->CarnetFolder->nodeExists($relativePath)){ $newPath = substr($relativePath, 0, strlen($relativePath)-4)." ".bin2hex(random_bytes(2)).".sqd"; @@ -1444,7 +1444,7 @@ public function getOpusEncoder(){ $file->delete(); } else { - $renamed[$relativePath] = substr($relativePath, 0, strlen($relativePath)-4)." ".substr(str_shuffle(str_repeat("abcdefghijklmnopqrstuvwxyz", 5)), 0, 5).".sqd"; + $renamed[$relativePath] = $newPath; } } -- cgit v1.2.3