ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
FilenameSanitizerPreProcessor.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
ILIAS\FileUpload\Processor
;
4
5
use
ILIAS\Filesystem\Stream\FileStream
;
6
use
ILIAS\FileUpload\DTO\Metadata
;
7
use
ILIAS\FileUpload\DTO\ProcessingStatus
;
8
use
League\Flysystem\Util
;
9
19
final
class
FilenameSanitizerPreProcessor
implements
PreProcessor
20
{
21
25
public
function
process
(
FileStream
$stream
,
Metadata
$metadata
)
26
{
27
$metadata->
setFilename
(
Util::normalizeRelativePath
($metadata->
getFilename
()));
28
29
return
new
ProcessingStatus
(
ProcessingStatus::OK
,
'Filename changed'
);
30
}
31
}
ILIAS\FileUpload\Processor\PreProcessor
Class PreProcessor.
Definition:
PreProcessor.php:22
ILIAS\FileUpload\DTO\ProcessingStatus
Class ProcessingStatus.
Definition:
ProcessingStatus.php:20
League\Flysystem\Util\normalizeRelativePath
static normalizeRelativePath($path)
Normalize relative directories in a path.
Definition:
Util.php:96
League\Flysystem\Util
Definition:
ContentListingFormatter.php:3
$metadata
$metadata['__DYNAMIC:1__']
Definition:
adfs-idp-hosted.php:3
GuzzleHttp\Psr7\$stream
$stream
PHP stream implementation.
Definition:
MessageTrait.php:21
ProcessingStatus
ILIAS\FileUpload\DTO\Metadata\getFilename
getFilename()
The filename supplied by the browser.
Definition:
Metadata.php:73
ILIAS\FileUpload\Processor
Definition:
BlacklistExtensionPreProcessor.php:3
ILIAS\FileUpload\DTO\Metadata
Class Metadata.
Definition:
Metadata.php:21
Metadata
ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor
Class FilenameSanitizerPreProcessor.
Definition:
FilenameSanitizerPreProcessor.php:19
ILIAS\FileUpload\Processor\FilenameSanitizerPreProcessor\process
process(FileStream $stream, Metadata $metadata)
Definition:
FilenameSanitizerPreProcessor.php:25
FileStream
php
ILIAS\FileUpload\DTO\Metadata\setFilename
setFilename($filename)
Overwrite the current filename.
Definition:
Metadata.php:87
ILIAS\Filesystem\Stream\FileStream
Interface FileStream.
Definition:
FileStream.php:20
ILIAS\FileUpload\DTO\ProcessingStatus\OK
const OK
Upload is ok.
Definition:
ProcessingStatus.php:26
src
FileUpload
Processor
FilenameSanitizerPreProcessor.php
Generated on Thu Jan 16 2025 19:02:37 for ILIAS by
1.8.13 (using
Doxyfile
)