mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-06-17 10:11:48 +02:00
Merge pull request #395 from DorsetDigital/patch-1
Change source of admin URL in getIsAdmin()
This commit is contained in:
commit
6a8f15a194
|
@ -62,7 +62,7 @@ class InitStateMiddleware implements HTTPMiddleware
|
||||||
public function getIsAdmin(HTTPRequest $request)
|
public function getIsAdmin(HTTPRequest $request)
|
||||||
{
|
{
|
||||||
$adminPaths = static::config()->get('admin_url_paths');
|
$adminPaths = static::config()->get('admin_url_paths');
|
||||||
$adminPaths[] = AdminRootController::config()->get('url_base') . '/';
|
$adminPaths[] = AdminRootController::admin_url();
|
||||||
$currentPath = rtrim($request->getURL(), '/') . '/';
|
$currentPath = rtrim($request->getURL(), '/') . '/';
|
||||||
foreach ($adminPaths as $adminPath) {
|
foreach ($adminPaths as $adminPath) {
|
||||||
if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
|
if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user