diff --git a/login/index.php b/login/index.php index e4293dc5ded..001cc9eb8ce 100644 --- a/login/index.php +++ b/login/index.php @@ -274,7 +274,8 @@ if (empty($SESSION->wantsurl)) { $_SERVER["HTTP_REFERER"] != $CFG->wwwroot && $_SERVER["HTTP_REFERER"] != $CFG->wwwroot.'/' && $_SERVER["HTTP_REFERER"] != $CFG->httpswwwroot.'/login/' && - $_SERVER["HTTP_REFERER"] != $CFG->httpswwwroot.'/login/index.php') + strpos($_SERVER["HTTP_REFERER"], $CFG->httpswwwroot.'/login/?') !== 0 && + strpos($_SERVER["HTTP_REFERER"], $CFG->httpswwwroot.'/login/index.php') !== 0) // There might be some extra params such as ?lang=. ? $_SERVER["HTTP_REFERER"] : NULL; }