]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Disable email attachment posting when $config['attachments']['uploads'] = false
authorCraig Andrews <candrews@integralblue.com>
Tue, 21 Jul 2009 14:12:37 +0000 (10:12 -0400)
committerCraig Andrews <candrews@integralblue.com>
Tue, 21 Jul 2009 14:12:37 +0000 (10:12 -0400)
http://laconi.ca/trac/ticket/1721

scripts/maildaemon.php

index 3f5402becb37113067e7767b6b2b65794549eb6a..a4003b6b26b5018748b51eab4ea8310410516114 100755 (executable)
@@ -318,9 +318,12 @@ class MailerDaemon
             && $parsed->ctype_secondary=='plain') {
             $msg = $parsed->body;
         }else if(!empty($parsed->body)){
-            $attachment = tmpfile();
-            fwrite($attachment, $parsed->body);
-            $attachments[] = $attachment;
+            if(common_config('attachments', 'uploads')){
+                //only save attachments if uploads are enabled
+                $attachment = tmpfile();
+                fwrite($attachment, $parsed->body);
+                $attachments[] = $attachment;
+            }
         }
     }