From 2961367e1ec3721086406564c19ca9e93fb689ba Mon Sep 17 00:00:00 2001 From: poltawski Date: Sun, 23 Dec 2007 13:30:06 +0000 Subject: [PATCH] MDL-10607 - support single quotes in db user/password in installer merged from MOODLE_19_STABLE --- install.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index a7e268caaf..63b25faa03 100644 --- a/install.php +++ b/install.php @@ -525,8 +525,9 @@ if ($nextstage == SAVE) { $str .= '$CFG->dbhost = \''.addslashes($INSTALL['dbhost'])."';\r\n"; if (!empty($INSTALL['dbname'])) { $str .= '$CFG->dbname = \''.$INSTALL['dbname']."';\r\n"; - $str .= '$CFG->dbuser = \''.$INSTALL['dbuser']."';\r\n"; - $str .= '$CFG->dbpass = \''.$INSTALL['dbpass']."';\r\n"; + // support single quotes in db user/passwords + $str .= '$CFG->dbuser = \''.addsingleslashes($INSTALL['dbuser'])."';\r\n"; + $str .= '$CFG->dbpass = \''.addsingleslashes($INSTALL['dbpass'])."';\r\n"; } $str .= '$CFG->dbpersist = false;'."\r\n"; $str .= '$CFG->prefix = \''.$INSTALL['prefix']."';\r\n"; @@ -1279,4 +1280,12 @@ function toggledbinfo() { -- 2.39.5