diff --git a/includes/file.inc b/includes/file.inc index 7d23d4a7ca9..71ec3c06b33 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -28,7 +28,7 @@ define('FILE_EXISTS_ERROR', 2); */ function file_create_url($path) { // 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())), '\\/'); } switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {