? .cache
? .cvsignore
? .git
? .project
? .settings
? empty
? file_30520_5.patch
? test
? upload_menu_alter.patch
? modules/file
? sites/all/modules
? sites/default/files
? sites/default/settings.php
? sites/default/test
Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.138
diff -u -p -r1.138 install.php
--- install.php	29 Oct 2008 10:08:51 -0000	1.138
+++ install.php	2 Nov 2008 19:59:17 -0000
@@ -940,7 +940,7 @@ function install_check_requirements($pro
     }
     elseif ($writable) {
       $requirements['settings file'] = array(
-        'title'       => st('Settings file'),
+        'title'       => st('Settings file'), 
         'value'       => st('Settings file is writable.'),
       );
     }
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.815
diff -u -p -r1.815 common.inc
--- includes/common.inc	1 Nov 2008 21:21:34 -0000	1.815
+++ includes/common.inc	2 Nov 2008 19:59:18 -0000
@@ -2847,7 +2847,7 @@ function drupal_system_listing($mask, $d
 
 /**
  * Hands off structured Drupal arrays to type-specific *_alter implementations.
- *
+ * 
  * This dispatch function hands off structured Drupal arrays to type-specific
  * *_alter implementations. It ensures a consistent interface for all altering
  * operations.
Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.140
diff -u -p -r1.140 file.inc
--- includes/file.inc	19 Oct 2008 20:18:58 -0000	1.140
+++ includes/file.inc	2 Nov 2008 19:59:19 -0000
@@ -814,25 +814,32 @@ function file_save_upload($source, $vali
 
 
   // If a file was uploaded, process it.
-  if (isset($_FILES['files']) && $_FILES['files']['name'][$source] && is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
+  if (isset($_FILES['files']) && $_FILES['files']['name'][$source]) {
     // Check for file upload errors and return FALSE if a lower level system
     // error occurred.
     switch ($_FILES['files']['error'][$source]) {
       // @see http://php.net/manual/en/features.file-upload.errors.php
-      case UPLOAD_ERR_OK:
-        break;
-
       case UPLOAD_ERR_INI_SIZE:
+        drupal_set_message(t("The file %file could not be saved, because it exceeds the server's upload file size limit of %maxsize.", array('%file' => $_FILES['files']['name'][$source], '%maxsize' => format_size(parse_size(ini_get('upload_max_filesize'))))), 'error');
+        return FALSE;
+
       case UPLOAD_ERR_FORM_SIZE:
-        drupal_set_message(t('The file %file could not be saved, because it exceeds %maxsize, the maximum allowed size for uploads.', array('%file' => $source, '%maxsize' => format_size(file_upload_max_size()))), 'error');
+        drupal_set_message(t("The file %file could not be saved, because it exceeds this form's size limit for file uploads.", array('%file' => $_FILES['files']['name'][$source])), 'error');
         return FALSE;
 
       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' => $source)), 'error');
+        drupal_set_message(t('The file %file could not be saved, because the upload did not complete.', array('%file' => $_FILES['files']['name'][$source])), 'error');
         return FALSE;
 
-        // Unknown error
+      case UPLOAD_ERR_OK:
+        // Final check that this is a valid upload, if it isn't, use the
+        // default error handler.
+        if (is_uploaded_file($_FILES['files']['tmp_name'][$source])) {
+           break;
+        }
+
+      // Unknown error
       default:
         drupal_set_message(t('The file %file could not be saved. An unknown error has occurred.', array('%file' => $source)), 'error');
         return FALSE;
