Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-07-18 12:44:10 +0300
committerJoas Schilling <coding@schilljs.com>2016-07-18 12:44:10 +0300
commit9781312648983c65135acac6eb014d74a454ed36 (patch)
tree536b9ac7580ef8f17c40211e5bce03870fe536f0 /lib
parent5157c5a9c4b08518dc86e5755b991183f4323c43 (diff)
Prevent syntax error when creating user or changing password
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Setup/PostgreSQL.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
index 30ca88f53aa..b4b0ebeb299 100644
--- a/lib/private/Setup/PostgreSQL.php
+++ b/lib/private/Setup/PostgreSQL.php
@@ -140,12 +140,12 @@ class PostgreSQL extends AbstractDatabase {
private function createDBUser(IDBConnection $connection) {
try {
- if ($this->userExists($connection, $this->dbUser)) {
+ if ($this->userExists($connection)) {
// change the password
- $query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " CREATEDB WITH PASSWORD " . addslashes($this->dbPassword));
+ $query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " CREATEDB WITH PASSWORD '" . addslashes($this->dbPassword) . "'");
} else {
// create the user
- $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD " . addslashes($this->dbPassword));
+ $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
}
$query->execute();
} catch (DatabaseException $e) {