Made path handling unicode-safe, use new Utils::basename() and Utils::pathinfo() everywhere

This commit is contained in:
Matias Griese
2022-01-26 14:11:10 +02:00
parent 4184f3261d
commit 396e32b76e
7 changed files with 27 additions and 20 deletions

View File

@@ -980,7 +980,7 @@ class Admin
$obj->file = $file;
$obj->page = $pages->get(dirname($obj->path));
$fileInfo = pathinfo($obj->title);
$fileInfo = Utils::pathinfo($obj->title);
$filename = str_replace(['@3x', '@2x'], '', $fileInfo['filename']);
if (isset($fileInfo['extension'])) {
$filename .= '.' . $fileInfo['extension'];
@@ -1979,7 +1979,7 @@ class Admin
$page = $path ? $pages->find($path, true) : $pages->root();
if (!$page) {
$slug = basename($path);
$slug = Utils::basename($path);
if ($slug === '') {
return null;