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

@@ -15,6 +15,7 @@ use Grav\Common\Page\Pages;
use Grav\Common\Uri;
use Grav\Common\User\Interfaces\UserCollectionInterface;
use Grav\Common\User\Interfaces\UserInterface;
use Grav\Common\Utils;
use Grav\Framework\RequestHandler\Exception\PageExpiredException;
use Grav\Framework\RequestHandler\Exception\RequestException;
use Grav\Plugin\Admin\Admin;
@@ -111,7 +112,7 @@ class LoginController extends AdminController
{
$uri = (string)$this->getRequest()->getUri();
$ext = pathinfo($uri, PATHINFO_EXTENSION);
$ext = Utils::pathinfo($uri, PATHINFO_EXTENSION);
$accept = $this->getAccept(['application/json', 'text/html']);
if ($ext === 'json' || $accept === 'application/json') {
return $this->createErrorResponse(new RequestException($this->getRequest(), $this->translate('PLUGIN_ADMIN.LOGGED_OUT'), 401));