ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor Class Reference

Class InsecureFilenameSanitizerPreProcessor. More...

+ Inheritance diagram for ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor:
+ Collaboration diagram for ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor:

Protected Member Functions

 checkPath (string $path)
 
 getRejectionMessage ()
 
 getOKMessage ()
 
- Protected Member Functions inherited from ILIAS\MetaData\Repository\Validation\Processor\AbstractRecursiveZipPreProcessor
 checkPath (string $path)
 
 getRejectionMessage ()
 
 getOKMessage ()
 

Private Attributes

array $prohibited_names
 

Additional Inherited Members

- Public Member Functions inherited from ILIAS\MetaData\Repository\Validation\Processor\AbstractRecursiveZipPreProcessor
 process (FileStream $stream, Metadata $metadata)
 This method gets invoked by the file upload service to process the file with the help of the processor. More...
 

Detailed Description

Class InsecureFilenameSanitizerPreProcessor.

PreProcessor which checks for file with potentially dangerous names

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 28 of file InsecureFilenameSanitizerPreProcessor.php.

Member Function Documentation

◆ checkPath()

ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor::checkPath ( string  $path)
protected

Definition at line 34 of file InsecureFilenameSanitizerPreProcessor.php.

References $parts.

34  : bool
35  {
36  $path = str_replace('\\', '/', $path);
37  $path = preg_replace('/\/+/', '/', $path);
38  $path = trim((string) $path, '/');
39  $parts = explode('/', $path);
40  foreach ($parts as $part) {
41  if (in_array($part, $this->prohibited_names)) {
42  return false;
43  }
44  }
45  return true;
46  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
$path
Definition: ltiservices.php:29

◆ getOKMessage()

ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor::getOKMessage ( )
protected

Definition at line 53 of file InsecureFilenameSanitizerPreProcessor.php.

53  : string
54  {
55  return 'Extension is not blacklisted.';
56  }

◆ getRejectionMessage()

ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor::getRejectionMessage ( )
protected

Definition at line 48 of file InsecureFilenameSanitizerPreProcessor.php.

48  : string
49  {
50  return 'A Security Issue has been detected, File-upload aborted...';
51  }

Field Documentation

◆ $prohibited_names

array ILIAS\MetaData\Repository\Validation\Processor\InsecureFilenameSanitizerPreProcessor::$prohibited_names
private
Initial value:
= [
'...'
]

Definition at line 30 of file InsecureFilenameSanitizerPreProcessor.php.


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