From c73aeb5c627ac1f3caa29b5bd6688ecdae2fc47b Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Wed, 13 Jun 2001 15:44:56 +0000 Subject: [PATCH] Make sure there is new data before deleting the old data --- phpgwapi/inc/class.config.inc.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/phpgwapi/inc/class.config.inc.php b/phpgwapi/inc/class.config.inc.php index 7dfa88cfe4..2736e40f6b 100755 --- a/phpgwapi/inc/class.config.inc.php +++ b/phpgwapi/inc/class.config.inc.php @@ -53,16 +53,19 @@ { $config_data = $this->config_data; - $this->db->lock('phpgw_config'); - $this->db->query("delete from phpgw_config where config_app='" . $this->appname . "'",__LINE__,__FILE__); - while (list($name,$value) = each($config_data)) + if ($config_data) { - $name = addslashes($name); - $value = addslashes($value); - $this->db->query("insert into phpgw_config (config_app,config_name,config_value) " - . "values ('" . $this->appname . "','" . $name . "','" . $value . "')",__LINE__,__FILE__); + $this->db->lock('phpgw_config'); + $this->db->query("delete from phpgw_config where config_app='" . $this->appname . "'",__LINE__,__FILE__); + while (list($name,$value) = each($config_data)) + { + $name = addslashes($name); + $value = addslashes($value); + $this->db->query("insert into phpgw_config (config_app,config_name,config_value) " + . "values ('" . $this->appname . "','" . $name . "','" . $value . "')",__LINE__,__FILE__); + } + $this->db->unlock(); } - $this->db->unlock(); } function delete_repository()