- Fixed case sensitive authentication tokens for Redis DSNs, closed #940

This commit is contained in:
Mark Friedrich
2020-04-11 22:25:01 +02:00
parent 4fc903d94b
commit a6f5777ada
2 changed files with 2 additions and 2 deletions

View File

@@ -914,7 +914,7 @@ class Setup extends Controller {
// -> the DSN format is not the same, convert URL format into DSN
if(
strtolower(session_module_name()) == 'redis' &&
($parts = parse_url(strtolower(session_save_path())))
($parts = parse_url(session_save_path()))
){
// parse URL parameters
parse_str((string)$parts['query'], $params);

View File

@@ -577,7 +577,7 @@ class Config extends \Prefab {
*/
static function parseDSN(string $dsn, ?array &$conf = []) : bool {
// reset reference
if($matches = (bool)preg_match('/^(\w+)\h*=\h*(.+)/', strtolower(trim($dsn)), $parts)){
if($matches = (bool)preg_match('/^(\w+)\h*=\h*(.+)/', trim($dsn), $parts)){
$conf['type'] = $parts[1];
if($conf['type'] == 'redis'){
[$conf['host'], $conf['port'], $conf['db'], $conf['auth']] = explode(':', $parts[2]) + [1 => 6379, 2 => null, 3 => null];