summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/file.inc b/includes/file.inc
index a09751574..36e7893ed 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -203,7 +203,7 @@ function file_stream_wrapper_valid_scheme($scheme) {
}
/**
- * Returns the target of a URI (e.g. a stream).
+ * Returns the part of an URI after the schema.
*
* @param $uri
* A stream, referenced as "scheme://target".
@@ -216,10 +216,10 @@ function file_stream_wrapper_valid_scheme($scheme) {
* @see file_uri_scheme()
*/
function file_uri_target($uri) {
- if ($scheme = file_uri_scheme($uri)) {
- return file_stream_wrapper_get_instance_by_scheme($scheme)->getTarget($uri);
- }
- return FALSE;
+ $data = explode('://', $uri, 2);
+
+ // Remove erroneous leading or trailing, forward-slashes and backslashes.
+ return count($data) == 2 ? trim($data[1], '\/') : FALSE;
}
/**