From: poltawski <poltawski>
Date: Sun, 23 Dec 2007 14:15:50 +0000 (+0000)
Subject: MDL-10607 - also support backslashes in dbuser/password in installer
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5690e088fc7350484c313fb3cf38eef595eee47f;p=moodle.git

MDL-10607 - also support backslashes in dbuser/password in installer
merged from MOODLE_19_STABLE
---

diff --git a/install.php b/install.php
index 63b25faa03..e36d68d2c0 100644
--- a/install.php
+++ b/install.php
@@ -1282,10 +1282,11 @@ function toggledbinfo() {
 }
 
 /**
- * Add slashes for single quotes so they can be
- * included in single quoted string
+ * Add slashes for single quotes and backslashes
+ * so they can be included in single quoted string
+ * (for config.php)
  */
 function addsingleslashes($input){
-    return str_replace("'", "\'", $input);
+    return preg_replace("/(['\\\])/", "\\\\$1", $input);
 }
 ?>