diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-30 17:45:32 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-30 17:45:32 +0000 |
commit | 27ccbf1f6ffcd071a8a7f62e99e122c4a1c4dd35 (patch) | |
tree | 9590a0cb240979ee7f2bca52931e51c0e37a6a7a /includes | |
parent | b3cb4f0d9b783d8ba52747931f5a6b3587a6a5c7 (diff) | |
download | brdo-27ccbf1f6ffcd071a8a7f62e99e122c4a1c4dd35.tar.gz brdo-27ccbf1f6ffcd071a8a7f62e99e122c4a1c4dd35.tar.bz2 |
#55520, improved docs, patch by dopry
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/includes/file.inc b/includes/file.inc index 2c3e8a5ec..1c79f9e82 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -27,11 +27,7 @@ define('FILE_EXISTS_ERROR', 2); * @return A string containing a URL that can be used to download the file. */ function file_create_url($path) { - // strip file_directory_paths from url if present. Prevent ugly and filesystem revealing - // urls like http://example.com/system/files/../../../home/gatsby/private/files - // I think it also keep absolute file_directory_paths working since they would get broken if - // we tried to pass them in the url. - + // Strip file_directory_path from $path. We only include relative paths in urls. if (strpos($path, file_directory_path()) !== false) { $path = trim(substr($path, strlen(file_directory_path())), '\\/'); } @@ -578,14 +574,11 @@ function file_transfer($source, $headers) { */ function file_download() { - //use the remainder of the path to get the file. - //enables 4.7 clean private files paths. + // Merge remainder of arguments from GET['q'], into relative file path. $args = func_get_args(); $filepath = implode('/', $args); - // add the ?file= if it is present. Otherwise we - // break all old nodes with private files displayed - // inline. + // Maintain compatability with old ?file=paths saved in node bodies. if (isset($_GET['file'])) { $filepath = $_GET['file']; } |