diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-05-17 20:49:54 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-05-17 20:49:54 +0000 |
commit | fa2469c1dd3eb60f97a1824e0a37c65f83f3e332 (patch) | |
tree | 6b9a6dd67b21dd119044d8cb0d2cf28f29d5aa31 /includes | |
parent | a5489b7b1c1df8f202eb4248537d5bb3da515f09 (diff) | |
download | brdo-fa2469c1dd3eb60f97a1824e0a37c65f83f3e332.tar.gz brdo-fa2469c1dd3eb60f97a1824e0a37c65f83f3e332.tar.bz2 |
- Patch #23028 by chx: fixed file_check_location() problems.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/file.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc index 9740836e7..c62334154 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -170,7 +170,14 @@ function file_check_upload($source) { * @return 0 for invalid path or the real path of the source. */ function file_check_location($source, $directory = 0) { - $source = realpath($source); + $check = realpath($source); + if ($check) { + $source = $check; + } + else { + // This file does not yet exist + $source = realpath(dirname($source)) .'/'. basename($source); + } $directory = realpath($directory); if ($directory && strpos($source, $directory) !== 0) { return 0; |