diff options
author | Phie <phie@phie.ovh> | 2020-11-05 01:19:45 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2020-11-05 01:19:45 +0300 |
commit | e027e1f4082db027e2bea7b050d0e62f5b8e1c34 (patch) | |
tree | e99229aec87897af425b9d12516e7d52911d35ed | |
parent | dae4f8f37606b05ab44fcc9bc5f8f4ed73f5760c (diff) |
fix stuffs
-rwxr-xr-x | lib/Controller/NoteController.php | 10 |
1 files 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; } } |