ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
InsecureFilenameSanitizerPreProcessor.php
Go to the documentation of this file.
1 <?php
2 
20 
29 {
30  private array $prohibited_names = [
31  '...'
32  ];
33 
34  protected function checkPath(string $path): 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  }
47 
48  protected function getRejectionMessage(): string
49  {
50  return 'A Security Issue has been detected, File-upload aborted...';
51  }
52 
53  protected function getOKMessage(): string
54  {
55  return 'Extension is not blacklisted.';
56  }
57 }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
$path
Definition: ltiservices.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...