From 8b55a4ec28af47c103ce8c0bc68b2d14e80cb335 Mon Sep 17 00:00:00 2001 From: daxelrod Date: Tue, 20 Sep 2022 09:28:51 -0400 Subject: [PATCH] Fix stream wrapper paths which must contain a double-slash. --- includes/Traits/Library.php | 3 +++ 1 file changed, 3 insertions(+) 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); }