X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmediafile.php;h=1c96c42d7a7245d8a9ac3537ddddd08cfa367839;hb=cfeb1bfa419e886a1b60dfcbd4260d2f5de0515b;hp=29d752f0c6c9a8489e7b209ea356af9677e07a07;hpb=d9cde0ef80ee838a99035d44f0286b3cc902e332;p=quix0rs-gnu-social.git diff --git a/lib/mediafile.php b/lib/mediafile.php index 29d752f0c6..1c96c42d7a 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -171,12 +171,12 @@ class MediaFile return; } - if (!MediaFile::respectsQuota($user, $_FILES['attach']['size'])) { + if (!MediaFile::respectsQuota($user, $_FILES[$param]['size'])) { // Should never actually get here @unlink($_FILES[$param]['tmp_name']); - throw new ClientException(_('File exceeds user\'s quota!')); + throw new ClientException(_('File exceeds user\'s quota.')); return; } @@ -198,7 +198,7 @@ class MediaFile } } else { - throw new ClientException(_('Could not determine file\'s mime-type!')); + throw new ClientException(_('Could not determine file\'s MIME type.')); return; } @@ -213,7 +213,7 @@ class MediaFile // Should never actually get here - throw new ClientException(_('File exceeds user\'s quota!')); + throw new ClientException(_('File exceeds user\'s quota.')); return; } @@ -234,7 +234,7 @@ class MediaFile $stream['uri'] . ' ' . $filepath)); } } else { - throw new ClientException(_('Could not determine file\'s mime-type!')); + throw new ClientException(_('Could not determine file\'s MIME type.')); return; } @@ -262,7 +262,7 @@ class MediaFile $filetype = MIME_Type::autoDetect($stream['uri']); } - if (in_array($filetype, common_config('attachments', 'supported'))) { + if (common_config('attachments', 'supported') === true || in_array($filetype, common_config('attachments', 'supported'))) { return $filetype; } $media = MIME_Type::getMedia($filetype); @@ -272,7 +272,7 @@ class MediaFile $hint = ''; } throw new ClientException(sprintf( - _('%s is not a supported filetype on this server.'), $filetype) . $hint); + _('%s is not a supported file type on this server.'), $filetype) . $hint); } static function respectsQuota($user, $filesize) @@ -286,4 +286,4 @@ class MediaFile } } -} \ No newline at end of file +}