Skip to content

Commit

Permalink
Merge pull request #22 from markhuot/fix-default-admin
Browse files Browse the repository at this point in the history
don't assume "admin" trigger
  • Loading branch information
markhuot authored Apr 12, 2024
2 parents 4ab8e97 + 27d9ccc commit 4b25d82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"prefer-stable": true,
"require-dev": {
"craftcms/phpstan": "dev-main",
"craftcms/craft": "^2.0",
"craftcms/craft": "^4.0",
"symfony/var-dumper": "^5.0|^6.0",
"laravel/pint": "^1.13"
}
Expand Down
2 changes: 1 addition & 1 deletion src/http/requests/WebRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function setDefaultProperties(string $url)
protected function uriContainsAdminSlug(string $uri): bool
{
$path = parse_url($uri, PHP_URL_PATH);
$slug = \Craft::$app->getConfig()->getGeneral()->cpTrigger ?? 'admin';
$slug = \Craft::$app->getConfig()->getGeneral()->cpTrigger;

return str_starts_with(ltrim($path, '/'), $slug);
}
Expand Down

0 comments on commit 4b25d82

Please sign in to comment.