diff --git a/includes/file.inc b/includes/file.inc
index de9d17d..8585d43 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1531,8 +1531,10 @@ function file_save_upload($form_field_name, $validators = array(), $destination
     // The .txt extension may not be in the allowed list of extensions. We have
     // to add it here or else the file upload will fail.
     if (!empty($extensions)) {
-      $validators['file_validate_extensions'][0] .= ' txt';
-      drupal_set_message(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $file->filename)));
+      $extensions_array = explode(" ", $extensions);
+      if(in_array("txt", $extensions_array)){
+        drupal_set_message(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $file->filename)));
+      }
     }
   }
 
