From 3eec9b84d1c9eab8262f976a4efe07d36bdc0265 Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 4 Apr 2007 05:06:51 +0000 Subject: [PATCH] #9601 git-svn-id: file:///svn/phpbb/trunk@7279 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 56235d8e88..cb7b43fb27 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -209,10 +209,14 @@ class acp_database $delete = request_var('delete', ''); $file = request_var('file', ''); - preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); + if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + { + trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $file_name = $phpbb_root_path . 'store/' . $matches[0]; - if (!(file_exists($file_name) && is_readable($file_name))) + if (!file_exists($file_name) || !is_readable($file_name))) { trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); }