diff --git a/includes/Traits/Library.php b/includes/Traits/Library.php index 200f572bd..057251f6f 100755 --- a/includes/Traits/Library.php +++ b/includes/Traits/Library.php @@ -231,6 +231,9 @@ public function safe_path($path) { $path = str_replace(['//', '\\\\'], ['/', '\\'], $path); + // Fix stream wrapper paths which must contain a double-slash (e.g. scheme://...) + $path = preg_replace( '#^([a-z][a-z0-9+\-.]*):/([^/])#i', '$1://$2', $path ); + return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path); }