Skip to content

Commit

Permalink
MFC: MDL-11857 missing addslashes on idnumber field during backup res…
Browse files Browse the repository at this point in the history
…tore
  • Loading branch information
skodak committed Oct 20, 2007
1 parent f7266dd commit aaf2778
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions backup/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2202,16 +2202,7 @@ function restore_create_users($restore,$xml_file) {
if ($create_user) {
//Unset the id because it's going to be inserted with a new one
unset ($user->id);
//We addslashes to necessary fields
$user->username = addslashes($user->username);
$user->firstname = addslashes($user->firstname);
$user->lastname = addslashes($user->lastname);
$user->email = addslashes($user->email);
$user->institution = addslashes($user->institution);
$user->department = addslashes($user->department);
$user->address = addslashes($user->address);
$user->city = addslashes($user->city);
$user->url = addslashes($user->url);
// relink the descriptions
$user->description = backup_todb($user->description);

//We need to analyse the AUTH field to recode it:
Expand Down Expand Up @@ -2244,7 +2235,7 @@ function restore_create_users($restore,$xml_file) {

//We are going to create the user
//The structure is exactly as we need
$newid = insert_record ("user",$user);
$newid = insert_record ("user", addslashes_recursive($user));
//Put the new id
$status = backup_putid($restore->backup_unique_code,"user",$userid,$newid,"new");
}
Expand Down

0 comments on commit aaf2778

Please sign in to comment.