mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-04 06:41:01 +01:00
Made path handling unicode-safe, use new Utils::basename() and Utils::pathinfo() everywhere
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user