]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/WikiHowProfile/WikiHowProfilePlugin.php
Merge branch 'master' of git.gnu.io:Quix0r/gnu-social
[quix0rs-gnu-social.git] / plugins / WikiHowProfile / WikiHowProfilePlugin.php
index 6f45da6a707cbbbe8efbafad2736ed94f311c0ab..1156ac933a4173a754c9ad573d99c62d1a5e19fb 100644 (file)
@@ -49,7 +49,7 @@ if (!defined('STATUSNET')) {
  */
 class WikiHowProfilePlugin extends Plugin
 {
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'WikiHow avatar fetcher',
                             'version' => GNUSOCIAL_VERSION,
@@ -154,7 +154,7 @@ class WikiHowProfilePlugin extends Plugin
             $absolute = $base->resolve($src);
             $avatarUrl = strval($absolute);
 
-            common_log(LOG_DEBUG, "WikiHow avatar found for $profileUrl - $avatarUrl");
+            common_debug("WikiHow avatar found for $profileUrl - $avatarUrl");
             $data['avatar'] = $avatarUrl;
         }
 
@@ -178,7 +178,7 @@ class WikiHowProfilePlugin extends Plugin
 
         // @todo FIXME: This should be better encapsulated
         // ripped from OStatus via oauthstore.php (for old OMB client)
-        $temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
+        $temp_filename = tempnam(common_get_temp_dir(), 'listener_avatar');
         try {
             if (!copy($url, $temp_filename)) {
                 // TRANS: Exception thrown when fetching an avatar from a URL fails.
@@ -188,9 +188,7 @@ class WikiHowProfilePlugin extends Plugin
 
             $profile = $user->getProfile();
             $id = $profile->id;
-            // @fixme should we be using different ids?
-
-            $imagefile = new ImageFile($id, $temp_filename);
+            $imagefile = new ImageFile(null, $temp_filename);
             $filename = Avatar::filename($id,
                                          image_type_to_extension($imagefile->type),
                                          null,