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 5 Nov 2008 20:46:54 -0000 @@ -90,7 +90,7 @@ define('FILE_STATUS_PERMANENT', 1); * @param $path A string containing the path of the file to generate URL for. * @return A string containing a URL that can be used to download the file. */ -function file_create_url($path) { +function file_create_url($path, $absolute = FALSE) { // Strip file_directory_path from $path. We only include relative paths in // URLs. if (strpos($path, file_directory_path() . '/') === 0) { @@ -98,9 +98,10 @@ function file_create_url($path) { } switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) { case FILE_DOWNLOADS_PUBLIC: - return $GLOBALS['base_url'] . '/' . file_directory_path() . '/' . str_replace('\\', '/', $path); + $base = ($absolute ? $GLOBALS['base_url'] . '/' : base_path()); + return $base . file_directory_path() . '/' . str_replace('\\', '/', $path); case FILE_DOWNLOADS_PRIVATE: - return url('system/files/' . $path, array('absolute' => TRUE)); + return url('system/files/' . $path, array('absolute' => $absolute)); } }