ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Filesystem\Provider\FlySystem\Util Class Reference
+ Collaboration diagram for ILIAS\Filesystem\Provider\FlySystem\Util:

Static Public Member Functions

static normalizeRelativePath (string $path)
 

Detailed Description

Definition at line 28 of file Util.php.

Member Function Documentation

◆ normalizeRelativePath()

static ILIAS\Filesystem\Provider\FlySystem\Util::normalizeRelativePath ( string  $path)
static

Definition at line 30 of file Util.php.

30 : string
31 {
32 $path = preg_replace("#\\\\(?!['\\\])#m", '/', $path); // this only replaces backslashes
33 $path = preg_replace('#\p{C}+#u', '', (string) $path);
34 $parts = [];
35
36 foreach (explode('/', (string) $path) as $part) {
37 switch ($part) {
38 case '':
39 case '.':
40 break;
41
42 case '..':
43 if (empty($parts)) {
44 throw new \LogicException(
45 'Path is outside of the defined root, path: [' . $path . ']'
46 );
47 }
48 array_pop($parts);
49 break;
50
51 default:
52 $parts[] = $part;
53 break;
54 }
55 }
56
57 return implode('/', $parts);
58 }
$path
Definition: ltiservices.php:30
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $parts, and $path.

Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess\read().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: