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:
Eloy Lafuente (stronk7)
2012-03-08 12:27:44 +01:00
parent c67bc65cbe
commit e85a54d931
+1 -1
View File
@@ -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 = '';