]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apiaccountupdateprofileimage.php
Merge remote-tracking branch 'mainline/1.0.x' into people_tags_rebase
[quix0rs-gnu-social.git] / actions / apiaccountupdateprofileimage.php
index f2886509d7cf4338ba994ab22e84c7ad90add934..986a8f3f1eed69c5c11d46dec84112b1e29458cb 100644 (file)
@@ -112,16 +112,17 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
             return;
         }
 
+        $type = $imagefile->preferredType();
         $filename = Avatar::filename(
             $user->id,
-            image_type_to_extension($imagefile->type),
+            image_type_to_extension($type),
             null,
             'tmp'.common_timestamp()
         );
 
         $filepath = Avatar::path($filename);
 
-        move_uploaded_file($imagefile->filepath, $filepath);
+        $imagefile->copyTo($filepath);
 
         $profile = $this->user->getProfile();
 
@@ -139,7 +140,7 @@ class ApiAccountUpdateProfileImageAction extends ApiAuthAction
 
         if ($this->format == 'xml') {
             $this->initDocument('xml');
-            $this->showTwitterXmlUser($twitter_user);
+            $this->showTwitterXmlUser($twitter_user, 'user', true);
             $this->endDocument('xml');
         } elseif ($this->format == 'json') {
             $this->initDocument('json');