Explorar el Código

Merge changes on Subs-Graphics.php

Signed-off-by: Suki <[email protected]>
Suki hace 10 años
padre
commit
ac11565a2c
Se han modificado 1 ficheros con 2 adiciones y 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;