diff options
author | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2003-12-27 14:28:23 +0000 |
---|---|---|
committer | Kjartan Mannes <kjartan@2.no-reply.drupal.org> | 2003-12-27 14:28:23 +0000 |
commit | 46f8f143225b7ef7ae7e8aa8c103275cc660f26b (patch) | |
tree | 34045d5425b843aace2734281a7f3d6f6a15be42 /includes | |
parent | 15f289a8f0ab4cc2e1253731ca5af5987b3af0d6 (diff) | |
download | brdo-46f8f143225b7ef7ae7e8aa8c103275cc660f26b.tar.gz brdo-46f8f143225b7ef7ae7e8aa8c103275cc660f26b.tar.bz2 |
- Fixed switch in file_create_url().
- Fixed profile module not extracting mime type.
- Improved file matching in profile module.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/includes/file.inc b/includes/file.inc index 2e8cd7b44..963dce118 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -14,7 +14,7 @@ * * function module_insert($node) { * if ($node->file) { - * file_save($node->file); + * file_save_upload($node->file); * } * } * @endcode @@ -29,13 +29,12 @@ define('FILE_SEPARATOR', PHP_OS == 'WINNT' ? '\\' : '/'); * Create the download path to a file. */ function file_create_url($path) { + if (strpos($path, variable_get('file_directory_path', 'files')) !== false) { + $path = trim(substr($path, strlen(variable_get('file_directory_path', 'files'))), '\\/'); + } switch (variable_get('file_downloads', FILE_DOWNLOADS_PRIVATE)) { case FILE_DOWNLOADS_PUBLIC: - case FILE_DOWNLOADS_PRIVATE: global $base_url; - if (strpos($path, variable_get('file_directory_path', 'files')) !== false) { - $path = trim(substr($path, strlen(variable_get('file_directory_path', 'files'))), '\\/'); - } return $base_url .'/'. variable_get('file_directory_path', 'files') .'/'. str_replace('\\', '/', $path); case FILE_DOWNLOADS_PRIVATE: return url('system/files', 'file='. $path); @@ -324,7 +323,7 @@ function file_download() { } } } - //drupal_not_found(); + drupal_not_found(); } /** |