Sfoglia il codice sorgente

Merge changes on Subs-Graphics.php

Signed-off-by: Suki <[email protected]>
Suki 10 anni fa
parent
commit
ac11565a2c
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  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;