1
0

Add missing active content check for renaming.

After fixing the other ML file renaming bugs,
it was now possible to rename a file without
extension into a file that *does* have an
extension - so we need to check against
active content.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
Thomas Hochstein
2020-03-25 13:47:17 +01:00
parent 0b2d6bf931
commit 21c3b0d83f

View File

@@ -2261,6 +2261,10 @@ function serendipity_renameFile($id, $newName, $path = null) {
$newPath = $imgBase . $path . $newName . (empty($File['extension']) ? '' : '.' . $File['extension']);
if (serendipity_isActiveFile($newName) || serendipity_isActiveFile($newPath)) {
return sprintf('<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> ' . ERROR_FILE_FORBIDDEN . "</span>\n", $newName);
}
if (file_exists($newPath)) {
return sprintf('<span class="msg_error"><span class="icon-attention-circled" aria-hidden="true"></span> ' . ERROR_FILE_EXISTS . "</span>\n", $newName);
}