diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-13 14:47:11 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-04-13 14:47:11 +0000 |
commit | ab9f95324679f96dd5ddd298fa0358675fc00ac6 (patch) | |
tree | b49455cb021c754789c3554f3d0d3397338856d1 /includes/file.inc | |
parent | 506c80bdb9a6ee159512fe8c62ba1a79ad46259d (diff) | |
download | brdo-ab9f95324679f96dd5ddd298fa0358675fc00ac6.tar.gz brdo-ab9f95324679f96dd5ddd298fa0358675fc00ac6.tar.bz2 |
#5961, use PHP constants for file uploads. Patch by dopry
Diffstat (limited to 'includes/file.inc')
-rw-r--r-- | includes/file.inc | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/includes/file.inc b/includes/file.inc index 6ce6ac503..c9aaf011b 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -186,24 +186,17 @@ function file_check_upload($source = 'upload') { // lower level system error occurred. switch ($_FILES["edit"]["error"][$source]) { - // We are not actually using the constants since they weren't introduced - // until php 4.3.0. - - // UPLOAD_ERR_OK: File uploaded successfully - case 0: + // @see http://php.net/manual/en/features.file-upload.errors.php + case UPLOAD_ERR_OK: break; - // UPLOAD_ERR_INI_SIZE: File size exceeded php.ini value - case 1: - // UPLOAD_ERR_FORM_SIZE: File size exceeded MAX_FILE_SIZE form value - case 2: + case UPLOAD_ERR_INI_SIZE: + case UPLOAD_ERR_FORM_SIZE: drupal_set_message(t('The file %file could not be saved, because it exceeds the maximum allowed size for uploads.', array('%file' => theme('placeholder', $source))), 'error'); return 0; - // UPLOAD_ERR_PARTIAL: File was only partially uploaded - case 3: - // UPLOAD_ERR_NO_FILE: No file was uploaded - case 4: + case UPLOAD_ERR_PARTIAL: + case UPLOAD_ERR_NO_FILE: drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => theme('placeholder', $source))), 'error'); return 0; |