Bug fix in string path slash fix

if null error return original path
This commit is contained in:
Clemens Schwaighofer
2024-03-07 14:37:05 +09:00
parent aac5157173
commit f59c325b05

View File

@@ -124,7 +124,7 @@ class Strings
* eg: //foo///bar/foo.inc -> /foo/bar/foo.inc
*
* @param string $path Path to strip slashes from
* @return string Clean path
* @return string Clean path, on error returns original path
*/
public static function stripMultiplePathSlashes(string $path): string
{
@@ -132,7 +132,7 @@ class Strings
'#/+#',
'/',
$path
);
) ?? $path;
}
}