19use ILIAS\ResourceStorage\Preloader\SecureString;
31 if (!preg_match(
'/^(.+?)(?<!\s)\.([^.]*$|$)/',
$filename, $matches)) {
34 return $this->secure($matches[2]);
37 protected function stripSuffix(
string $title, ?
string $suffix =
null): string
41 if ($suffix !==
null && ($length = strrpos($title,
"." . $suffix)) > 0) {
42 $title = substr($title, 0, $length);
45 return $this->secure($title);
48 protected function ensureSuffix(
string $title, ?
string $suffix =
null): string
53 if ($suffix !==
null && strrpos((
string) $title,
"." . $suffix) ===
false) {
54 $title .=
"." . $suffix;
57 return $this->secure(rtrim((
string) $title,
"."));
65 if ($suffix !==
null && strrpos((
string) $title,
"." . $suffix) ===
false) {
66 $title .=
" (" . $suffix .
")";
69 return $this->secure($title);
ensureSuffixInBrackets(string $title, ?string $suffix=null)
trait ilObjFileSecureString
Trait ilObjFileSecureString.
stripSuffix(string $title, ?string $suffix=null)
ensureSuffix(string $title, ?string $suffix=null)
extractSuffixFromFilename(string $filename)