Normalizes a URI by making it syntactically correct.
A stream is referenced as "scheme://target".
The following actions are taken:
$uri: String reference containing the URI to normalize.
The normalized URI.
function file_stream_wrapper_uri_normalize($uri) {
// Inline file_uri_scheme() function call for performance reasons.
$position = strpos($uri, '://');
$scheme = $position ? substr($uri, 0, $position) : FALSE;
if ($scheme && file_stream_wrapper_valid_scheme($scheme)) {
$target = file_uri_target($uri);
if ($target !== FALSE) {
$uri = $scheme . '://' . $target;
}
}
return $uri;
}