Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new columns of 2.4.10 to the update script, enclose birthday value #389

Merged
merged 2 commits into from Jul 16, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+5 −3
Diff settings

Always

Just for now

Copy path View file
@@ -1913,13 +1913,13 @@ function create_backup_file($mode=0)
$backup->assign("#\n");
$backup->assign("TRUNCATE TABLE ".$db_settings['userdata_table'].";\n");
$backup->assign("TRUNCATE TABLE ".$db_settings['userdata_cache_table'].";\n");
$result = @mysqli_query($connid, "SELECT user_id, user_type, user_name, user_real_name, gender, birthday, user_pw, user_email, email_contact, user_hp, user_location, signature, profile, logins, last_login, last_logout, user_ip, registered, category_selection, thread_order, user_view, sidebar, fold_threads, thread_display, new_posting_notification, new_user_notification, user_lock, auto_login_code, pwf_code, activate_code, language, time_zone, time_difference, theme FROM ".$db_settings['userdata_table']) or $error=true;
$result = @mysqli_query($connid, "SELECT user_id, user_type, user_name, user_real_name, gender, birthday, user_pw, user_email, email_contact, user_hp, user_location, signature, profile, logins, last_login, last_logout, user_ip, registered, category_selection, thread_order, user_view, sidebar, fold_threads, thread_display, new_posting_notification, new_user_notification, user_lock, auto_login_code, pwf_code, activate_code, language, time_zone, time_difference, theme, tou_accepted, dps_accepted FROM ".$db_settings['userdata_table']) or $error=true;
$time_start = TIMESTAMP;
while($data = mysqli_fetch_array($result))
{
$data['user_name'] = mysqli_real_escape_string($connid, $data['user_name']);
$data['user_real_name'] = mysqli_real_escape_string($connid, $data['user_real_name']);
$data['birthday'] = !is_null($data['birthday']) ? mysqli_real_escape_string($connid, $data['birthday']) : 'NULL';
$data['birthday'] = !is_null($data['birthday']) ? "'".mysqli_real_escape_string($connid, $data['birthday'])."'" : 'NULL';
$data['user_pw'] = mysqli_real_escape_string($connid, $data['user_pw']);
$data['user_email'] = mysqli_real_escape_string($connid, $data['user_email']);
$data['user_hp'] = mysqli_real_escape_string($connid, $data['user_hp']);
@@ -1941,7 +1941,9 @@ function create_backup_file($mode=0)
$data['auto_login_code'] = mysqli_real_escape_string($connid, $data['auto_login_code']);
$data['pwf_code'] = mysqli_real_escape_string($connid, $data['pwf_code']);
$data['activate_code'] = mysqli_real_escape_string($connid, $data['activate_code']);
$backup->assign("INSERT INTO ".$db_settings['userdata_table']." VALUES (".$data['user_id'].", ".$data['user_type'].", '".$data['user_name']."', '".$data['user_real_name']."', ".$data['gender'].", ".$data['birthday'].", '".$data['user_pw']."', '".$data['user_email']."', ".$data['email_contact'].", '".$data['user_hp']."', '".$data['user_location']."', '".$data['signature']."', '".$data['profile']."', ".$data['logins'].", ".$data['last_login'].", ".$data['last_logout'].", '".$data['user_ip']."', ".$data['registered'].", ".$data['category_selection'].", ".$data['thread_order'].", ".$data['user_view'].", ".$data['sidebar'].", ".$data['fold_threads'].", ".$data['thread_display'].", ".$data['new_posting_notification'].", ".$data['new_user_notification'].", ".$data['user_lock'].", '".$data['auto_login_code']."', '".$data['pwf_code']."', '".$data['activate_code']."', '".$data['language']."', '".$data['time_zone']."', ".$data['time_difference'].", '".$data['theme']."');\n");
$data['tou_accepted'] = !is_null($data['tou_accepted']) ? "'".mysqli_real_escape_string($connid, $data['tou_accepted'])."'" : 'NULL';
$data['dps_accepted'] = !is_null($data['dps_accepted']) ? "'".mysqli_real_escape_string($connid, $data['dps_accepted'])."'" : 'NULL';
$backup->assign("INSERT INTO ".$db_settings['userdata_table']." VALUES (".$data['user_id'].", ".$data['user_type'].", '".$data['user_name']."', '".$data['user_real_name']."', ".$data['gender'].", ".$data['birthday'].", '".$data['user_pw']."', '".$data['user_email']."', ".$data['email_contact'].", '".$data['user_hp']."', '".$data['user_location']."', '".$data['signature']."', '".$data['profile']."', ".$data['logins'].", ".$data['last_login'].", ".$data['last_logout'].", '".$data['user_ip']."', ".$data['registered'].", ".$data['category_selection'].", ".$data['thread_order'].", ".$data['user_view'].", ".$data['sidebar'].", ".$data['fold_threads'].", ".$data['thread_display'].", ".$data['new_posting_notification'].", ".$data['new_user_notification'].", ".$data['user_lock'].", '".$data['auto_login_code']."', '".$data['pwf_code']."', '".$data['activate_code']."', '".$data['language']."', '".$data['time_zone']."', ".$data['time_difference'].", '".$data['theme']."', ".$data['tou_accepted'].", ".$data['dps_accepted'].");\n");
}
mysqli_free_result($result);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.