Explorar o código

Merge changes on Subs-Graphics.php

Signed-off-by: Suki <[email protected]>
Suki %!s(int64=10) %!d(string=hai) anos
pai
achega
ac11565a2c
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Sources/Subs-Graphics.php

+ 2 - 1
Sources/Subs-Graphics.php

@@ -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;