Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…to false-correct usernames
  • Loading branch information...
commit c67bc65cbec7e9f0f3d3502f5383fd9193251d0e 1 parent f8adbd6
Eloy Lafuente (stronk7) authored

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  lib/moodlelib.php
8  lib/moodlelib.php
@@ -2765,12 +2765,12 @@ function get_moodle_cookie() {
2765 2765
         return '';
2766 2766
     } else {
2767 2767
         $username = rc4decrypt($_COOKIE[$cookiename], true);
2768  
-        $username = moodle_strtolower($username);
2769  
-        $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $username);
  2768
+        $userdata = moodle_strtolower($username);
  2769
+        $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $userdata);
2770 2770
         if ($username != $userdata) {
2771 2771
             $username = rc4decrypt($_COOKIE[$cookiename]);
2772  
-            $username = moodle_strtolower($username);
2773  
-            $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $username);
  2772
+            $userdata = moodle_strtolower($username);
  2773
+            $userdata = preg_replace('/[^-\.@_a-z0-9]/', '', $userdata);
2774 2774
             if ($userdata == $userdata) {
2775 2775
                 set_moodle_cookie($username);
2776 2776
             } else {

0 notes on commit c67bc65

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