From 9a0ad16272ccb461a5864b2a0cd8aa8f769ffdad Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 2 May 2006 17:59:51 +0000 Subject: [PATCH] - Bug #1709 git-svn-id: file:///svn/phpbb/trunk@5874 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 5249969eb1..cf01af7a07 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -46,7 +46,7 @@ class acp_database $format = request_var('method', ''); $where = request_var('where', ''); - $store = $download = false; + $store = $download = $structure = $schema_data = false; if ($where == 'store_and_download' || $where == 'store') { @@ -58,6 +58,16 @@ class acp_database $download = true; } + if ($type == 'full' || $type == 'structure') + { + $structure = true; + } + + if ($type == 'full' || $type == 'data') + { + $schema_data = true; + } + @set_time_limit(1200); $filename = time(); @@ -142,7 +152,7 @@ class acp_database foreach ($table as $table_name) { // Get the table structure - if ($type == 'full' || $type == 'structure') + if ($structure) { switch (SQL_LAYER) { @@ -194,7 +204,7 @@ class acp_database $sql_data = ''; // Data - if ($type == 'full' || $type == 'data') + if ($schema_data) { $sql_data .= "\n"; @@ -1040,20 +1050,18 @@ class acp_database } $file = request_var('file', ''); - $data = ''; preg_match('#^(\d{10})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); + $data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]); + switch ($matches[2]) { - case 'sql': - $data = file_get_contents($phpbb_root_path . 'store/' . $matches[0]); - break; case 'sql.bz2': - $data = bzdecompress(file_get_contents($phpbb_root_path . 'store/' . $matches[0])); + $data = bzdecompress($data); break; case 'sql.gz': - $data = implode(gzfile($phpbb_root_path . 'store/' . $matches[0])); + $data = gzinflate(substr($data, 10)); break; }