- Patch #60441 by dopry: fixed file_create_url().

5.x
Dries Buytaert 2006-06-09 05:41:25 +00:00
parent cf14d26cff
commit 6c38bc57e8
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ define('FILE_EXISTS_ERROR', 2);
*/ */
function file_create_url($path) { function file_create_url($path) {
// Strip file_directory_path from $path. We only include relative paths in urls. // Strip file_directory_path from $path. We only include relative paths in urls.
if (strpos($path, file_directory_path()) !== false) { if (strpos($path, file_directory_path() . '/') === 0) {
$path = trim(substr($path, strlen(file_directory_path())), '\\/'); $path = trim(substr($path, strlen(file_directory_path())), '\\/');
} }
switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) { switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {