Merge branch 'w39_MDL-41223_m26_customlogin' of https://github.com/skodak/moodle
authorMarina Glancy <marina@moodle.com>
Wed, 25 Sep 2013 00:54:19 +0000 (10:54 +1000)
committerMarina Glancy <marina@moodle.com>
Wed, 25 Sep 2013 00:54:19 +0000 (10:54 +1000)
login/index.php

index c4e21f6..45d1a58 100644 (file)
@@ -275,7 +275,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;
 }