Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31248 - lib - prevent moodle_strtolower() silent discard to lead …

…to false-correct usernames
  • Loading branch information...
commit c67bc65cbec7e9f0f3d3502f5383fd9193251d0e 1 parent f8adbd6
@stronk7 stronk7 authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/moodlelib.php
View
8 lib/moodlelib.php
@@ -2765,12 +2765,12 @@ function get_moodle_cookie() {
return '';
} else {
$username = rc4decrypt($_COOKIE[$cookiename], true);
- $username = moodle_strtolower($username);
- $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $username);
+ $userdata = moodle_strtolower($username);
+ $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $userdata);
if ($username != $userdata) {
$username = rc4decrypt($_COOKIE[$cookiename]);
- $username = moodle_strtolower($username);
- $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $username);
+ $userdata = moodle_strtolower($username);
+ $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $userdata);
if ($userdata == $userdata) {
set_moodle_cookie($username);
} else {

0 comments on commit c67bc65

Please sign in to comment.
Something went wrong with that request. Please try again.