From 11b9eb0350020b10e142c125d04c2e320833fc39 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 7 Feb 2022 20:48:28 +0200 Subject: [PATCH] allow IP4 subnets and % wildcard when creating MariaDB/MySQL users --- setup/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/index.php b/setup/index.php index 8e94db0580..3067ecf98a 100644 --- a/setup/index.php +++ b/setup/index.php @@ -301,7 +301,8 @@ switch($GLOBALS['egw_info']['setup']['stage']['db']) { case 'dbcreate': $GLOBALS['egw_setup']->db->create_database($_POST['db_root'], $_POST['db_pass'], 'utf8', // create all new db's with utf8 - !preg_match('/^[0-9.a-z_]+$/i', $_POST['db_grant_host']) ? 'localhost' : $_POST['db_grant_host']); + !preg_match('/^([0-9.a-z_%-]+|([0-9]{1,3}\.){3}[0-9]{1,3}(\/\d+)?)$/i', $_POST['db_grant_host']) ? + 'localhost' : $_POST['db_grant_host']); break; case 'drop': Api\Csrf::validate($_POST['csrf_token'], __FILE__);