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($title,
"." . $suffix) ===
false) {
54 $title .=
"." . $suffix;
57 return $this->secure(rtrim($title,
"."));
65 if ($suffix !== null && strrpos($title,
"." . $suffix) ===
false) {
66 $title .=
" (" . $suffix .
")";
69 return $this->secure($title);
ensureSuffixInBrackets(string $title, ?string $suffix=null)
extractSuffixFromFilename(string $filename)
stripSuffix(string $title, ?string $suffix=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ensureSuffix(string $title, ?string $suffix=null)