From 5e59f78c8f0697f71ae1a34c69b18696f9d09612 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 3 Jun 2007 17:57:40 +0000 Subject: [PATCH] "fixed bug reported on the list: not working backup&restore because of blob columns: they get base64 encoded now" --- phpgwapi/inc/class.db_backup.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.db_backup.inc.php b/phpgwapi/inc/class.db_backup.inc.php index 94000a7ae6..94f2d26365 100644 --- a/phpgwapi/inc/class.db_backup.inc.php +++ b/phpgwapi/inc/class.db_backup.inc.php @@ -98,7 +98,7 @@ case 'sapdb': case 'maxdb': //$this->system_tables = '/^(sql_cursor.*|session_roles|activeconfiguration|cachestatistics|commandcachestatistics|commandstatistics|datastatistics|datavolumes|hotstandbycomponent|hotstandbygroup|instance|logvolumes|machineconfiguration|machineutilization|memoryallocatorstatistics|memoryholders|omslocks|optimizerinformation|sessions|snapshots|spinlockstatistics|version)$/i'; - $this->egw_tables = '/^(egw_|phpgw_)/i'; + $this->egw_tables = '/^(egw_|phpgw_|g2_)/i'; break; } } @@ -302,6 +302,10 @@ } $arr[$key] = str_replace(BACKSLASH_TOKEN,'\\',str_replace(array('\\\\','\\n','\\r','\\"'),array(BACKSLASH_TOKEN,"\n","\r",'"'),substr($field,1,-1))); } + elseif ($keys && (strlen($field) > 64 || !is_numeric($field) && $field != 'NULL')) + { + $arr[$key] = base64_decode($field); + } else { $arr[$key] = $field == 'NULL' ? NULL : $field; @@ -330,6 +334,9 @@ case 'date': case 'timestamp': break; + case 'blob': + $data = base64_encode($data); + break; default: $data = '"'.str_replace(array('\\',"\n","\r",'"'),array('\\\\','\\n','\\r','\\"'),$data).'"'; break;