]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/imagefile.php
Changed thumbnail-only chmod to attachment-general chmod as recommended by mmn.
[quix0rs-gnu-social.git] / lib / imagefile.php
index d2f281254b028f6f8f4b078a2140a8588a53cdf6..926617e6a26df9ff5c9dd8463e787c4725944e5a 100644 (file)
@@ -253,6 +253,9 @@ class ImageFile
             if ($this->rotate == 0) {
                 // No rotational difference, just copy it as-is
                 @copy($this->filepath, $outpath);
+
+                // And set chmod
+                @chmod($outpath, common_config('attachments', 'chmod');
                 return $outpath;
             } elseif (abs($this->rotate) == 90) {
                 // Box is rotated 90 degrees in either direction,
@@ -351,6 +354,9 @@ class ImageFile
             throw new Exception(_('Unknown file type'));
         }
 
+        // Always chmod 0644 (default) to have other processes (e.g. queue daemon read it)
+        @chmod($outpath, common_config('attachments', 'chmod');
+
         imagedestroy($image_src);
         imagedestroy($image_dest);
     }