diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-02-01 19:07:07 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-02-01 19:07:07 +0000 |
commit | 5c07276020b7be4abd68c18dbdf4c2bf6df259ce (patch) | |
tree | fdef52f9c348e0676a0829b19cd4362ed752b6e0 | |
parent | 10fd10cf455bf21f7799c6c9b245808f5262733a (diff) | |
download | brdo-5c07276020b7be4abd68c18dbdf4c2bf6df259ce.tar.gz brdo-5c07276020b7be4abd68c18dbdf4c2bf6df259ce.tar.bz2 |
- Patch #700160 by naxoc: drupal_realpath() did not always work as expected.
-rw-r--r-- | includes/file.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc index b03e9d4d9..1b06895af 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -1831,9 +1831,14 @@ function drupal_realpath($uri) { if ($wrapper = file_stream_wrapper_get_instance_by_uri($uri)) { return $wrapper->realpath(); } - else { + // Check that the uri has a value. There is a bug in PHP 5.2 on *BSD systems + // that makes realpath not return FALSE as expected when passing an empty + // variable. + // @todo Remove when Drupal drops support for PHP 5.2. + elseif (!empty($uri)) { return realpath($uri); } + return FALSE; } /** |