]> git.mjollnir.org Git - moodle.git/commitdiff
Added addslashes() to check for existing users, because some characters
authorstronk7 <stronk7>
Sun, 4 Jan 2004 22:58:28 +0000 (22:58 +0000)
committerstronk7 <stronk7>
Sun, 4 Jan 2004 22:58:28 +0000 (22:58 +0000)
can break the query (old users containing ', for example).

backup/restorelib.php

index f2cb989a4be3c1bf428145119699a3740cde1d06..0c1ac79bbe61b57ed6d98cc58c0ada490f44fb6c 100644 (file)
                 $newid=null;
                 //check if it exists (by username) and get its id
                 $user_exists = true;
-                $user_data = get_record("user","username",$user->username);
+                $user_data = get_record("user","username",addslashes($user->username));
                 if (!$user_data) {
                     $user_exists = false;
                 } else {