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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user