MDL-31248 - lib - Gah, erroneus condition fixed.
For sure that leaded to accept anything as valid username for cookies in 19_STABLE. That explains why garbled username were being transformed into "invented" usernames, instead of blank.
This commit is contained in:
+1
-1
@@ -2771,7 +2771,7 @@ function get_moodle_cookie() {
|
||||
$username = rc4decrypt($_COOKIE[$cookiename]);
|
||||
$userdata = moodle_strtolower($username);
|
||||
$userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $userdata);
|
||||
if ($userdata == $userdata) {
|
||||
if ($username == $userdata) {
|
||||
set_moodle_cookie($username);
|
||||
} else {
|
||||
$username = '';
|
||||
|
||||
Reference in New Issue
Block a user