|
@@ -87,8 +87,9 @@ function downloadAvatar($url, $memID, $max_width, $max_height)
|
|
|
if ($success)
|
|
|
{
|
|
|
// Remove the .tmp extension from the attachment.
|
|
|
- if (rename($destName . '.tmp', $destName))
|
|
|
+ if (rename($destName . '.tmp', empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash . '.dat'))
|
|
|
{
|
|
|
+ $destName = empty($avatar_hash) ? $destName : $path . '/' . $attachID . '_' . $avatar_hash . '.dat';
|
|
|
list ($width, $height) = getimagesize($destName);
|
|
|
$mime_type = 'image/' . $ext;
|
|
|
|