ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Util.php
Go to the documentation of this file.
1
<?php
2
declare(strict_types=1);
3
4
namespace
ILIAS\Filesystem\Provider\FlySystem
;
5
11
class
Util
extends
\League\Flysystem\Util
12
{
13
18
public
static
function
normalizeRelativePath
($path)
19
{
20
$path = preg_replace(
"#\\\\(?!['\\\])#m"
,
'/'
, $path);
// this only replaces backslashes
21
$path = static::removeFunkyWhiteSpace($path);
22
$parts = [];
23
24
foreach
(explode(
'/'
, $path) as $part) {
25
switch
($part) {
26
case
''
:
27
case
'.'
:
28
break
;
29
30
case
'..'
:
31
if
(empty($parts)) {
32
throw
new \LogicException(
33
'Path is outside of the defined root, path: ['
. $path .
']'
34
);
35
}
36
array_pop($parts);
37
break
;
38
39
default
:
40
$parts[] = $part;
41
break
;
42
}
43
}
44
45
$path = implode(
'/'
, $parts);
46
47
return
$path;
48
}
49
50
}
ILIAS\Filesystem\Provider\FlySystem\Util
Definition:
Util.php:11
ILIAS\Filesystem\Provider\FlySystem
Definition:
FlySystemDirectoryAccess.php:4
ILIAS\Filesystem\Provider\FlySystem\Util\normalizeRelativePath
static normalizeRelativePath($path)
Definition:
Util.php:18
src
Filesystem
Provider
FlySystem
Util.php
Generated on Mon Sep 1 2025 21:01:45 for ILIAS by
1.8.13 (using
Doxyfile
)