From 46ec22fa979c9ef4aae0f25a6307ae10dcff60db Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Wed, 18 Apr 2001 16:46:40 +0000 Subject: [PATCH] Add addslashes to fix upgrade problems (Bug #417076) --- setup/sql/mysql_upgrade_beta.inc.php | 28 ++++++++++++++-------------- setup/sql/pgsql_upgrade_beta.inc.php | 28 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/setup/sql/mysql_upgrade_beta.inc.php b/setup/sql/mysql_upgrade_beta.inc.php index 5d4127b2f7..9be0877e19 100644 --- a/setup/sql/mysql_upgrade_beta.inc.php +++ b/setup/sql/mysql_upgrade_beta.inc.php @@ -1112,23 +1112,23 @@ while ($db1->next_record()) { $fields['id'] = $db1->f("ab_id"); - $fields['owner'] = $db1->f("ab_owner"); - $fields['n_given'] = $db1->f("ab_firstname"); - $fields['n_family'] = $db1->f("ab_lastname"); - $fields['d_email'] = $db1->f("ab_email"); - $fields['b_tel'] = $db1->f("ab_hphone"); - $fields['a_tel'] = $db1->f("ab_wphone"); - $fields['c_tel'] = $db1->f("ab_fax"); - $fields['fn'] = $db1->f("ab_firstname")." ".$db1->f("ab_lastname"); + $fields['owner'] = addslashes($db1->f("ab_owner")); + $fields['n_given'] = addslashes($db1->f("ab_firstname")); + $fields['n_family'] = addslashes($db1->f("ab_lastname")); + $fields['d_email'] = addslashes($db1->f("ab_email")); + $fields['b_tel'] = addslashes($db1->f("ab_hphone")); + $fields['a_tel'] = addslashes($db1->f("ab_wphone")); + $fields['c_tel'] = addslashes($db1->f("ab_fax")); + $fields['fn'] = addslashes($db1->f("ab_firstname")." ".$db1->f("ab_lastname")); $fields["a_tel_work"] = "y"; $fields["b_tel_home"] = "y"; $fields["c_tel_fax"] = "y"; - $fields['org_name'] = $db1->f("ab_company"); - $fields['title'] = $db1->f("ab_title"); - $fields['adr_street'] = $db1->f("ab_street"); - $fields['adr_locality'] = $db1->f("ab_city"); - $fields['adr_region'] = $db1->f("ab_state"); - $fields['adr_postalcode'] = $db1->f("ab_zip"); + $fields['org_name'] = addslashes($db1->f("ab_company")); + $fields['title'] = addslashes($db1->f("ab_title")); + $fields['adr_street'] = addslashes($db1->f("ab_street")); + $fields['adr_locality'] = addslashes($db1->f("ab_city")); + $fields['adr_region'] = addslashes($db1->f("ab_state")); + $fields['adr_postalcode'] = addslashes($db1->f("ab_zip")); $extra['pager'] = $db1->f("ab_pager"); $extra['mphone'] = $db1->f("ab_mphone"); diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index 01642d6c07..858416d4e3 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -1209,23 +1209,23 @@ while ($db1->next_record()) { $fields['id'] = $db1->f("ab_id"); - $fields['owner'] = $db1->f("ab_owner"); - $fields['n_given'] = $db1->f("ab_firstname"); - $fields['n_family'] = $db1->f("ab_lastname"); - $fields['d_email'] = $db1->f("ab_email"); - $fields['b_tel'] = $db1->f("ab_hphone"); - $fields['a_tel'] = $db1->f("ab_wphone"); - $fields['c_tel'] = $db1->f("ab_fax"); - $fields['fn'] = $db1->f("ab_firstname")." ".$db1->f("ab_lastname"); + $fields['owner'] = addslashes($db1->f("ab_owner")); + $fields['n_given'] = addslashes($db1->f("ab_firstname")); + $fields['n_family'] = addslashes($db1->f("ab_lastname")); + $fields['d_email'] = addslashes($db1->f("ab_email")); + $fields['b_tel'] = addslashes($db1->f("ab_hphone")); + $fields['a_tel'] = addslashes($db1->f("ab_wphone")); + $fields['c_tel'] = addslashes($db1->f("ab_fax")); + $fields['fn'] = addslashes($db1->f("ab_firstname")." ".$db1->f("ab_lastname")); $fields["a_tel_work"] = "y"; $fields["b_tel_home"] = "y"; $fields["c_tel_fax"] = "y"; - $fields['org_name'] = $db1->f("ab_company"); - $fields['title'] = $db1->f("ab_title"); - $fields['adr_street'] = $db1->f("ab_street"); - $fields['adr_locality'] = $db1->f("ab_city"); - $fields['adr_region'] = $db1->f("ab_state"); - $fields['adr_postalcode'] = $db1->f("ab_zip"); + $fields['org_name'] = addslashes($db1->f("ab_company")); + $fields['title'] = addslashes($db1->f("ab_title")); + $fields['adr_street'] = addslashes($db1->f("ab_street")); + $fields['adr_locality'] = addslashes($db1->f("ab_city")); + $fields['adr_region'] = addslashes($db1->f("ab_state")); + $fields['adr_postalcode'] = addslashes($db1->f("ab_zip")); $extra['pager'] = $db1->f("ab_pager"); $extra['mphone'] = $db1->f("ab_mphone");