ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
FilenameSanitizerPreProcessor.php
Go to the documentation of this file.
1
<?php
2
19
namespace
ILIAS\FileUpload\Processor
;
20
21
use
ILIAS\Filesystem\Stream\FileStream
;
22
use
ILIAS\FileUpload\DTO\Metadata
;
23
use
ILIAS\FileUpload\DTO\ProcessingStatus
;
24
use
League\Flysystem\Util
;
25
35
final
class
FilenameSanitizerPreProcessor
implements
PreProcessor
36
{
40
public
function
process
(
FileStream
$stream,
Metadata
$metadata):
ProcessingStatus
41
{
42
$filename
= $metadata->
getFilename
();
43
44
// remove some special characters
45
$filename
=
\ILIAS\Filesystem\Util::sanitizeFileName
(
$filename
);
46
47
$metadata->
setFilename
(Util::normalizeRelativePath(
$filename
));
48
49
return
new
ProcessingStatus
(
ProcessingStatus::OK
,
'Filename changed'
);
50
}
51
}
ILIAS\FileUpload\Processor\PreProcessor
Class PreProcessor.
Definition:
PreProcessor.php:35
ILIAS\FileUpload\DTO\ProcessingStatus
Class ProcessingStatus.
Definition:
ProcessingStatus.php:36
ILIAS\FileUpload\DTO\Metadata\setFilename
setFilename(string $filename)
Overwrite the current filename.
Definition:
Metadata.php:73
Util
ProcessingStatus
ILIAS\FileUpload\DTO\Metadata\getFilename
getFilename()
The filename supplied by the browser.
Definition:
Metadata.php:60
ILIAS\Filesystem\Util\sanitizeFileName
static sanitizeFileName(string $filename)
Definition:
Util.php:36
ILIAS\FileUpload\Processor
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
AbstractRecursiveZipPreProcessor.php:19
ILIAS\FileUpload\DTO\Metadata
Class Metadata.
Definition:
Metadata.php:21
$filename
$filename
Definition:
buildRTE.php:78
Metadata
ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor
Class FilenameSanitizerPreProcessor.
Definition:
FilenameSanitizerPreProcessor.php:35
ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor\process
process(FileStream $stream, Metadata $metadata)
Definition:
FilenameSanitizerPreProcessor.php:40
FileStream
ILIAS\Filesystem\Stream\FileStream
Interface FileStream.
Definition:
FileStream.php:33
ILIAS\FileUpload\DTO\ProcessingStatus\OK
const OK
Upload is ok.
Definition:
ProcessingStatus.php:42
src
FileUpload
Processor
FilenameSanitizerPreProcessor.php
Generated on Tue Apr 1 2025 22:02:44 for ILIAS by
1.8.13 (using
Doxyfile
)