From fef6ede20be00703b1a7549a35712feff98bc52f Mon Sep 17 00:00:00 2001 From: Gerhard Killesreiter Date: Sun, 26 Mar 2006 15:02:51 +0000 Subject: #55910, fix warnings in file.inc, patch by chx. --- includes/file.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/file.inc b/includes/file.inc index 60d176892..eccdb2fc7 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -311,6 +311,7 @@ function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { // Make sure we at least have a valid directory. if ($basename === false) { + $source = is_object($source) ? $source->filepath : $source; drupal_set_message(t('The selected file %file could not be uploaded, because the destination %directory is not properly configured.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), 'error'); watchdog('file system', t('The selected file %file could not not be uploaded, because the destination %directory could not be found, or because its permissions do not allow the file to be written.', array('%file' => theme('placeholder', $source), '%directory' => theme('placeholder', $dest))), WATCHDOG_ERROR); return 0; @@ -414,7 +415,7 @@ function file_move(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) { if ($path_original == $path_current || file_delete($path_original)) { return 1; } - drupal_set_message(t('The removal of the original file %file has failed.', array('%file' => theme('placeholder', $source))), 'error'); + drupal_set_message(t('The removal of the original file %file has failed.', array('%file' => theme('placeholder', $path_original))), 'error'); } return 0; } -- cgit v1.2.3