]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make file command configurable
authorEvan Prodromou <evan@controlyourself.ca>
Tue, 23 Jun 2009 12:35:20 +0000 (05:35 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Tue, 23 Jun 2009 12:35:20 +0000 (05:35 -0700)
README
actions/newnotice.php
lib/common.php

diff --git a/README b/README
index de10996006668fd50ea6184e65deb0b09c656194..1a57d6a80e53d6ed09e78862f26e52893b0a8c04 100644 (file)
--- a/README
+++ b/README
@@ -1232,6 +1232,10 @@ supported: an array of mime types you accept to store and distribute,
            setup your server to properly reckognize the types you want to
            support.
 uploads:   false to disable uploading files with notices (true by default).
+filecommand: The required MIME_Type library may need to use the 'file'
+            command. It tries the one in the Web server's path, but if
+            you're having problems with uploads, try setting this to the
+            correct value. Note: 'file' must accept '-b' and '-i' options.
 
 For quotas, be sure you've set the upload_max_filesize and post_max_size
 in php.ini to be large enough to handle your upload. In httpd.conf
index 09652d2b362225df867ee1ed4b68473ac503ca14..b7d9ec1dd0c8f96927b6db3270e9501101323c18 100644 (file)
@@ -116,6 +116,9 @@ class NewnoticeAction extends Action
     function getUploadedFileType() {
         require_once 'MIME/Type.php';
 
+        $cmd = &PEAR::getStaticProperty('MIME_Type', 'fileCmd');
+        $cmd = common_config('attachments', 'filecommand');
+
         $filetype = MIME_Type::autoDetect($_FILES['attach']['tmp_name']);
         if (in_array($filetype, common_config('attachments', 'supported'))) {
             return $filetype;
index 20f1ab35e1db2b610fc896a0424b5c23718a5078..76eb4a9785228b33c40eec6a749968b57825ff69 100644 (file)
@@ -202,7 +202,7 @@ $config =
         array('run' => 'web',
               'frequency' => 10000,
               'reporturl' => 'http://laconi.ca/stats/report'),
-        'attachments' => 
+        'attachments' =>
         array('server' => null,
               'dir' => INSTALLDIR . '/file/',
               'path' => $_path . '/file/',
@@ -241,6 +241,7 @@ $config =
         'user_quota' => 50000000,
         'monthly_quota' => 15000000,
         'uploads' => true,
+        'filecommand' => '/usr/bin/file',
         ),
         'group' =>
         array('maxaliases' => 3),