- case UPLOAD_ERR_OK: // success, jump out
- break;
- case UPLOAD_ERR_INI_SIZE:
- // TRANS: Client exception thrown when an uploaded file is too large.
- throw new ClientException(_m('The uploaded file exceeds the ' .
- 'upload_max_filesize directive in php.ini.'));
- return;
- case UPLOAD_ERR_FORM_SIZE:
- throw new ClientException(
- // TRANS: Client exception thrown when an uploaded file is too large.
- _m('The uploaded file exceeds the MAX_FILE_SIZE directive' .
- ' that was specified in the HTML form.'));
- return;
- case UPLOAD_ERR_PARTIAL:
- @unlink($_FILES[ImportDeliciousForm::FILEINPUT]['tmp_name']);
- // TRANS: Client exception thrown when a file was only partially uploaded.
- throw new ClientException(_m('The uploaded file was only' .
- ' partially uploaded.'));
- return;
- case UPLOAD_ERR_NO_FILE:
- // No file; probably just a non-AJAX submission.
- // TRANS: Client exception thrown when a file upload has failed.
- throw new ClientException(_m('No uploaded file.'));
- return;
- case UPLOAD_ERR_NO_TMP_DIR:
- // TRANS: Client exception thrown when a temporary folder is not present.
- throw new ClientException(_m('Missing a temporary folder.'));
- return;
- case UPLOAD_ERR_CANT_WRITE:
- // TRANS: Client exception thrown when writing to disk is not possible.
- throw new ClientException(_m('Failed to write file to disk.'));
- return;
- case UPLOAD_ERR_EXTENSION:
- // TRANS: Client exception thrown when a file upload has been stopped.
- throw new ClientException(_m('File upload stopped by extension.'));
- return;
- default:
- common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
- $_FILES[ImportDeliciousForm::FILEINPUT]['error']);
- // TRANS: Client exception thrown when a file upload operation has failed.
- throw new ClientException(_m('System error uploading file.'));
- return;
+ case UPLOAD_ERR_OK: // success, jump out
+ break;
+ case UPLOAD_ERR_INI_SIZE:
+ // TRANS: Client exception thrown when an uploaded file is too large.
+ throw new ClientException(_m('The uploaded file exceeds the ' .
+ 'upload_max_filesize directive in php.ini.'));
+ case UPLOAD_ERR_FORM_SIZE:
+ throw new ClientException(
+ // TRANS: Client exception thrown when an uploaded file is too large.
+ _m('The uploaded file exceeds the MAX_FILE_SIZE directive' .
+ ' that was specified in the HTML form.'));
+ case UPLOAD_ERR_PARTIAL:
+ @unlink($_FILES[ImportDeliciousForm::FILEINPUT]['tmp_name']);
+ // TRANS: Client exception thrown when a file was only partially uploaded.
+ throw new ClientException(_m('The uploaded file was only' .
+ ' partially uploaded.'));
+ case UPLOAD_ERR_NO_FILE:
+ // No file; probably just a non-AJAX submission.
+ // TRANS: Client exception thrown when a file upload has failed.
+ throw new ClientException(_m('No uploaded file.'));
+ case UPLOAD_ERR_NO_TMP_DIR:
+ // TRANS: Client exception thrown when a temporary folder is not present.
+ throw new ClientException(_m('Missing a temporary folder.'));
+ case UPLOAD_ERR_CANT_WRITE:
+ // TRANS: Client exception thrown when writing to disk is not possible.
+ throw new ClientException(_m('Failed to write file to disk.'));
+ case UPLOAD_ERR_EXTENSION:
+ // TRANS: Client exception thrown when a file upload has been stopped.
+ throw new ClientException(_m('File upload stopped by extension.'));
+ default:
+ common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " .
+ $_FILES[ImportDeliciousForm::FILEINPUT]['error']);
+ // TRANS: Client exception thrown when a file upload operation has failed.
+ throw new ClientException(_m('System error uploading file.'));