diff --git a/app/class/Modelmedia.php b/app/class/Modelmedia.php index 70681115..8d83ef77 100644 --- a/app/class/Modelmedia.php +++ b/app/class/Modelmedia.php @@ -389,10 +389,14 @@ public function multimovefile(array $filedirlist, string $dir): bool */ public function rename(string $oldname, string $newname) { - if (empty(basename($newname))) { + $newbasename = trim(basename($newname)); + $newdirname = dirname($newname); + if (empty($newbasename)) { throw new Fileexception("new name of file cannot be empty"); } + $newname = "$newdirname/$newbasename"; + Fs::accessfile($oldname); Fs::accessfile($newname); diff --git a/app/fn/fn.php b/app/fn/fn.php index 9500a0e4..5ffe5092 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -2,7 +2,7 @@ function readablesize($bytes, $base = 2 ** 10) { - $format = ' %d %s'; + $format = '%d %s'; if ($base === 2 ** 10) { $i = 'i'; diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php index 2c9f8319..6c77435c 100644 --- a/app/view/templates/editrightbar.php +++ b/app/view/templates/editrightbar.php @@ -12,70 +12,69 @@ class="toggle"
edition: | += $page->editcount() ?> | +
display: | += $page->displaycount() ?> | +
visit: | += $page->visitcount() ?> | +