From 095db7a3a82b2920728cd7f7b356a6385ae25878 Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Sat, 11 May 2019 21:46:53 +0200 Subject: [PATCH] - Fixed DB DNS parsing. Allow hyphens or underscores in DB names, closed #780 --- app/main/lib/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/lib/config.php b/app/main/lib/config.php index d1a7698a..1ce9ee9d 100644 --- a/app/main/lib/config.php +++ b/app/main/lib/config.php @@ -301,7 +301,7 @@ class Config extends \Prefab { 'PASS' => self::getEnvironmentData('DB_' . $alias . '_PASS') ]; - $pdoReg = '/^(?[[:alpha:]]+):((host=(?[a-zA-Z0-9\.]*))|(unix_socket=(?[a-zA-Z0-9\/]*\.sock)))((;dbname=(?\w*))|(;port=(?\d*))){0,2}/'; + $pdoReg = '/^(?[[:alpha:]]+):((host=(?[a-zA-Z0-9-_\.]*))|(unix_socket=(?[a-zA-Z0-9\/]*\.sock)))((;dbname=(?\w*))|(;port=(?\d*))){0,2}/'; if(preg_match($pdoReg, self::getEnvironmentData('DB_' . $alias . '_DNS'), $matches)){ // remove unnamed matches $matches = array_intersect_key($matches, $config);