From 43c0ac275f4a0a4589ee01254715834d3e3fec79 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Mon, 30 May 2016 18:28:50 +0200 Subject: [PATCH] Correctly handle language strings to termine if it's admin or not Fix https://github.com/getgrav/grav-plugin-admin/issues/627 --- system/src/Grav/Common/Session.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Session.php b/system/src/Grav/Common/Session.php index 0edbe65d23..04205b659d 100644 --- a/system/src/Grav/Common/Session.php +++ b/system/src/Grav/Common/Session.php @@ -42,7 +42,10 @@ public function init() // Uri::route() is not processed yet, let's quickly get what we need $current_route = str_replace($base_url, '', parse_url($uri->url(true), PHP_URL_PATH)); $base = '/' . trim($route, '/'); - if (substr($current_route, 0, strlen($base)) == $base) { + + if (substr($current_route, 0, strlen($base)) == $base || //handle no language specified + substr($current_route, 3, strlen($base)) == $base || //handle language (en) + substr($current_route, 6, strlen($base)) == $base) { //handle region specific language prefix (en-US) $session_timeout = $config->get('plugins.admin.session.timeout', 1800); $is_admin = true; }