]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix for #2663: fix for original/96px-size avatars getting saved with bad permissions...
authorBrion Vibber <brion@status.net>
Tue, 7 Sep 2010 23:49:05 +0000 (16:49 -0700)
committerBrion Vibber <brion@status.net>
Tue, 7 Sep 2010 23:52:02 +0000 (16:52 -0700)
The original-size file is now forced to 0644 (all-readable), which should help. Not sure this is 100% ideal, but it's better than 0600!
(The other sizes were being created in other code and had sane read perms already.)

Watch out for similar issues in Twitter bridge etc; avatar import code should get cleaned up and consolidated.

plugins/OStatus/classes/Ostatus_profile.php

index 6a0fd1f3bd4de2d1ee6b8e5f048022377dd584f7..19fe5169b4f19b32dbcb112f538745b28d17d159 100644 (file)
@@ -1065,6 +1065,14 @@ class Ostatus_profile extends Memcached_DataObject
                                      null,
                                      common_timestamp());
         rename($temp_filename, Avatar::path($filename));
+        // @fixme hardcoded chmod is lame, but seems to be necessary to
+        // keep from accidentally saving images from command-line (queues)
+        // that can't be read from web server, which causes hard-to-notice
+        // problems later on:
+        //
+        // http://status.net/open-source/issues/2663
+        chmod(Avatar::path($filename), 0644);
+
         $self->setOriginal($filename);
 
         $orig = clone($this);