diff options
author | Friendika <info@friendika.com> | 2011-08-03 19:18:58 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-03 19:18:58 -0700 |
commit | ad1e827169d9f57c02746b51c5268bdbe2cd8ac9 (patch) | |
tree | a6770ab49f632a8a63f1738b05eec3de32c1ea8b /mod/wall_attach.php | |
parent | d0b7723bbcd4e9a4fd5c97370bd1c738fdcdab28 (diff) | |
download | volse-hubzilla-ad1e827169d9f57c02746b51c5268bdbe2cd8ac9.tar.gz volse-hubzilla-ad1e827169d9f57c02746b51c5268bdbe2cd8ac9.tar.bz2 volse-hubzilla-ad1e827169d9f57c02746b51c5268bdbe2cd8ac9.zip |
several fixes for attachments
Diffstat (limited to 'mod/wall_attach.php')
-rw-r--r-- | mod/wall_attach.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mod/wall_attach.php b/mod/wall_attach.php index f18fd10b7..ef6554df3 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -60,11 +60,11 @@ function wall_attach_post(&$a) { } $filedata = @file_get_contents($src); - - $mimetype = mime_content_type($src); + $mimetype = z_mime_content_type($filename); + if((! strlen($mimetype)) || ($mimetype === 'application/octet-stream') && function_exists('mime_content_type')) + $mimetype = mime_content_type($filename); $hash = random_string(); $created = datetime_convert(); - $r = q("INSERT INTO `attach` ( `uid`, `hash`, `filename`, `filetype`, `filesize`, `data`, `created`, `edited`, `allow_cid`, `allow_gid`,`deny_cid`, `deny_gid` ) VALUES ( %d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", intval($page_owner_uid), |