From 148e1449d1d3c7fff87bbfbe8c9878f164b0cbbc Mon Sep 17 00:00:00 2001 From: Ian Date: Sun, 5 Oct 2014 19:46:49 +0200 Subject: [PATCH] extends 9cbb2b0 for file renaming type='file' with a pdf also. Thumb check and the silencer were both needed, else for the last the database entry was lost. The $renameData['thumb'] could very well be $file['thumbnail_name'] in case of not being empty. It might be that this has dependencies with the hotlink hook or thumbSuffix renamings. Garvin, please check. References #220 --- include/functions_images.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/functions_images.inc.php b/include/functions_images.inc.php index d187ab35..a26416e0 100644 --- a/include/functions_images.inc.php +++ b/include/functions_images.inc.php @@ -3438,8 +3438,8 @@ function serendipity_moveMediaDirectory($oldDir, $newDir, $type = 'dir', $item_i foreach($renameValues AS $renameData) { // Rename thumbnail - rename($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['name'] . (!empty($renameData['fthumb']) ? '.' . $renameData['fthumb'] : '') . (empty($file['extension']) ? '' : '.' . $file['extension']), - $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $newDir . '.' . $renameData['thumb'] . (empty($file['extension']) ? '' : '.' . $file['extension'])); + @rename($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['name'] . (!empty($renameData['fthumb']) ? '.' . $renameData['fthumb'] : '') . (empty($file['extension']) ? '' : '.' . $file['extension']), + $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $newDir . (!empty($file['thumbnail_name']) ? '.' . $renameData['thumb'] : '') . (empty($file['extension']) ? '' : '.' . $file['extension'])); } serendipity_updateImageInDatabase(array('thumbnail_name' => $renameValues[0]['thumb'], 'realname' => $newDir, 'name' => $newDir), $item_id);