From 1f14f7c327e52ec67a593d3d0b87e67a4bf7ebd6 Mon Sep 17 00:00:00 2001 From: Ruben Calvo Date: Tue, 30 Oct 2018 11:16:51 +0000 Subject: [PATCH] [ticket/15860] Fix format of backup files PHPBB3-15860 --- phpBB/includes/acp/acp_database.php | 4 ++-- phpBB/includes/functions.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index b98756a34b..fbc4f045ad 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -203,7 +203,7 @@ class acp_database $file = $request->variable('file', ''); $download = $request->variable('download', ''); - if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + if (!preg_match('#^backup_\d{10,}_[a-z\d]+\.(sql(?:\.(?:gz|bz2))?)$#i', $file, $matches)) { trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -402,7 +402,7 @@ class acp_database { while (($file = readdir($dh)) !== false) { - if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + if (preg_match('#^backup_(\d{10,})_[a-z\d]+\.(sql(?:\.(?:gz|bz2))?)$#i', $file, $matches)) { if (in_array($matches[2], $methods)) { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3fec88a354..79d88fb3a5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -115,7 +115,7 @@ function gen_rand_string_friendly($num_chars = 8) */ function unique_id() { - return gen_rand_string(32); + return strtolower(gen_rand_string(32)); } /**