35 $this->stack[] = $policy;
40 foreach ($this->stack as $policy) {
41 if (!$policy->isValidExtension($extension)) {
50 foreach ($this->stack as $policy) {
51 if (!$policy->isBlockedExtension($extension)) {
60 foreach ($this->stack as $policy) {
61 $filename_with_extension = $policy->prepareFileNameForConsumer($filename_with_extension);
63 return $filename_with_extension;
66 public function check(
string $extension): bool
68 foreach ($this->stack as $policy) {
69 $policy->check($extension);
isBlockedExtension(string $extension)
prepareFileNameForConsumer(string $filename_with_extension)
Interface FileNamePolicy.
isValidExtension(string $extension)
addPolicy(FileNamePolicy $policy)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class FileNamePolicyStack.