plugins/SpecialUserPrefs.php
changeset 329 0437a7cf1acc
parent 328 dc838fd61a06
child 334 c72b545f1304
--- a/plugins/SpecialUserPrefs.php	Thu Dec 20 22:23:07 2007 -0500
+++ b/plugins/SpecialUserPrefs.php	Fri Dec 21 18:21:20 2007 -0500
@@ -708,6 +708,8 @@
               break;
             }
             
+            $avi_path_new = ENANO_ROOT . '/' . getConfig('avatar_directory') . '/' . $session->user_id . '.' . $file_type;
+            
             // The file type is good - validate dimensions and animation
             switch($file_type)
             {
@@ -752,7 +754,8 @@
               break;
             }
             // All good!
-            if ( rename($tempfile, $avi_path) )
+            @unlink($avi_path);
+            if ( rename($tempfile, $avi_path_new) )
             {
               $q = $db->sql_query('UPDATE ' . table_prefix . "users SET user_has_avatar = 1, avatar_type = '$file_type' WHERE user_id = {$session->user_id};");
               if ( !$q )