mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Change source of admin URL in getIsAdmin()
As per #394 Change direct call to the AdminRootController config setting, using instead the admin_url() method on the class which provides detection via the Director rules, and the fallback to the config setting.
This commit is contained in:
parent
19f0162265
commit
1e458ef03d
@ -62,7 +62,7 @@ class InitStateMiddleware implements HTTPMiddleware
|
||||
public function getIsAdmin(HTTPRequest $request)
|
||||
{
|
||||
$adminPaths = static::config()->get('admin_url_paths');
|
||||
$adminPaths[] = AdminRootController::config()->get('url_base') . '/';
|
||||
$adminPaths[] = AdminRootController::admin_url();
|
||||
$currentPath = rtrim($request->getURL(), '/') . '/';
|
||||
foreach ($adminPaths as $adminPath) {
|
||||
if (substr($currentPath, 0, strlen($adminPath)) === $adminPath) {
|
||||
|
Loading…
Reference in New Issue
Block a user