From: Craig Andrews Date: Tue, 21 Jul 2009 14:12:37 +0000 (-0400) Subject: Disable email attachment posting when $config['attachments']['uploads'] = false X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fbb0df9f5436e956c43ace372f625f08628c000f;p=quix0rs-gnu-social.git Disable email attachment posting when $config['attachments']['uploads'] = false http://laconi.ca/trac/ticket/1721 --- diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 3f5402becb..a4003b6b26 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -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; + } } }