From: Mikael Nordfeldth Date: Tue, 8 Mar 2016 00:59:58 +0000 (+0100) Subject: Super special case where we should copy files instead of mv X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4360c65ed9a03633553c53857c72b0a1ef0d024b;p=quix0rs-gnu-social.git Super special case where we should copy files instead of mv --- diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php index 3f36e26563..4a4b25ff4d 100644 --- a/classes/File_thumbnail.php +++ b/classes/File_thumbnail.php @@ -188,8 +188,9 @@ class File_thumbnail extends Managed_DataObject // If we have a file in our old thumbnail storage path, move it to the new one if (file_exists($oldpath) && !file_exists($thumbpath)) { if ($this->getFilename() === $this->getFile()->filename) { - // special case where thumbnail file exactly matches stored File - common_debug('File filename and File_thumbnail filename match on '.$this->file_id); + // special case where thumbnail file exactly matches stored File filename + common_debug('File filename and File_thumbnail filename match on '.$this->file_id.', copying instead'); + copy($oldpath, $thumbpath); } elseif (!rename($oldpath, $thumbpath)) { common_log(LOG_ERR, 'Could not move thumbnail from '._ve($oldpath).' to '._ve($thumbpath)); throw new ServerException('Could not move thumbnail from old path to new path.');