diff --git a/login/index.php b/login/index.php index 25312086d8a..151daec1f8f 100644 --- a/login/index.php +++ b/login/index.php @@ -314,7 +314,7 @@ if (!empty($CFG->alternateloginurl)) { $loginurlstr = $loginurl->out(false); - if (strpos($SESSION->wantsurl, $loginurlstr) === 0) { + if ($SESSION->wantsurl != '' && strpos($SESSION->wantsurl, $loginurlstr) === 0) { // We do not want to return to alternate url. $SESSION->wantsurl = null; }