X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmediafile.php;h=e3d5b1dbcc40a1a7cbf58af5d4c316ff221f5af9;hb=ecb3abf84c8b6e868a523b8e721484cb7a4e0f63;hp=d4d184dd0fd37b79165e97ff452d9b0736c0e5e5;hpb=4e9ec0d0e1aeb43b432f4692b4819beb9408ad3b;p=quix0rs-gnu-social.git diff --git a/lib/mediafile.php b/lib/mediafile.php index d4d184dd0f..e3d5b1dbcc 100644 --- a/lib/mediafile.php +++ b/lib/mediafile.php @@ -152,6 +152,9 @@ class MediaFile throw new ClientException(_('The uploaded file was only' . ' partially uploaded.')); return; + case UPLOAD_ERR_NO_FILE: + // No file; probably just a non-AJAX submission. + return; case UPLOAD_ERR_NO_TMP_DIR: throw new ClientException(_('Missing a temporary folder.')); return; @@ -162,6 +165,8 @@ class MediaFile throw new ClientException(_('File upload stopped by extension.')); return; default: + common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " . + $_FILES[$param]['error']); throw new ClientException(_('System error uploading file.')); return; } @@ -171,7 +176,7 @@ class MediaFile // 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; } @@ -193,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; } @@ -208,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; } @@ -229,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; } @@ -267,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) @@ -281,4 +286,4 @@ class MediaFile } } -} \ No newline at end of file +}