From 71f55240ce8283c6c27f52fae8a72a1f773cf393 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sun, 10 Mar 2024 14:15:02 +0000 Subject: [PATCH] Adjustments for RegEx --- install/includes/core_class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/includes/core_class.php b/install/includes/core_class.php index 947af4050..ee1dd6088 100644 --- a/install/includes/core_class.php +++ b/install/includes/core_class.php @@ -118,8 +118,8 @@ class Core $database_file = file_get_contents($template_path); // Sanitize DB Password from single quotes - $sanitized_db_pwd = preg_replace("/\\/i",'\\\\',$data['db_password']); // Escape the Escape char ( '\' becomes '\\' ) - $sanitized_db_pwd = preg_replace("/\'/i",'\\\'',$data['db_password']); // Escape the ' ( ' becomes \' ) + $sanitized_db_pwd = preg_replace("/\\\/i",'\\\\',$input); // Escape the Escape char ( '\' becomes '\\' ) + $sanitized_db_pwd = preg_replace("/\'/i",'\\\\\'',$sanitized_db_pwd); // Escape the ' ( ' becomes \' ) $new = str_replace("%HOSTNAME%", $data['db_hostname'], $database_file); $new = str_replace("%USERNAME%", $data['db_username'], $new);