Skip to content

Commit

Permalink
MDL-31248 - lib - Gah, erroneus condition fixed.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stronk7 committed Mar 8, 2012
1 parent c67bc65 commit e85a54d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Expand Up @@ -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 = '';
Expand Down

0 comments on commit e85a54d

Please sign in to comment.