Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -65,7 +65,7 @@ class Filename
$attributes['format'] ??
pathinfo($filename, PATHINFO_EXTENSION)
);
$this->name = $this->sanitizeName(pathinfo($filename, PATHINFO_FILENAME));
$this->name = $this->sanitizeName($filename);
}
/**
@@ -227,24 +227,21 @@ class Filename
/**
* Sanitizes the file extension.
* The extension will be converted
* to lowercase and `jpeg` will be
* replaced with `jpg`
* It also replaces `jpeg` with `jpg`.
*/
protected function sanitizeExtension(string $extension): string
{
$extension = strtolower($extension);
$extension = F::safeExtension('test.' . $extension);
$extension = str_replace('jpeg', 'jpg', $extension);
return $extension;
}
/**
* Sanitizes the name with Kirby's
* Str::slug function
* Sanitizes the file name
*/
protected function sanitizeName(string $name): string
{
return Str::slug($name);
return F::safeBasename($name);
}
/**