diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-09 15:36:14 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-12-09 15:36:14 +0100 |
commit | 0d6134f512a4b7da5af03a208c27f24c5f0c82d6 (patch) | |
tree | e239e8b1dc47949883be2deb77cb0d7a79eff071 /lib/private/Setup/PostgreSQL.php | |
parent | de8908bf29d1e23f1ce5a41fcde02e1bf588b1a4 (diff) | |
download | nextcloud-server-0d6134f512a4b7da5af03a208c27f24c5f0c82d6.tar.gz nextcloud-server-0d6134f512a4b7da5af03a208c27f24c5f0c82d6.zip |
Revert "Quote database and role in queries"
This reverts commit 9ebd5d5bb20af9178e071c3c6f3b41d9a9bc8be0.
Diffstat (limited to 'lib/private/Setup/PostgreSQL.php')
-rw-r--r-- | lib/private/Setup/PostgreSQL.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index 4f4f8a03231..14325a18efe 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -111,7 +111,7 @@ class PostgreSQL extends AbstractDatabase { private function createDatabase(IDBConnection $connection) { if (!$this->databaseExists($connection)) { //The database does not exists... let's create it - $query = $connection->prepare("CREATE DATABASE \"" . addslashes($this->dbName) . "\" OWNER '" . addslashes($this->dbUser) . "'"); + $query = $connection->prepare("CREATE DATABASE " . addslashes($this->dbName) . " OWNER " . addslashes($this->dbUser)); try { $query->execute(); } catch (DatabaseException $e) { @@ -119,7 +119,7 @@ class PostgreSQL extends AbstractDatabase { $this->logger->logException($e); } } else { - $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE \"" . addslashes($this->dbName) . "\" FROM PUBLIC"); + $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE " . addslashes($this->dbName) . " FROM PUBLIC"); try { $query->execute(); } catch (DatabaseException $e) { @@ -153,10 +153,10 @@ class PostgreSQL extends AbstractDatabase { try { if ($this->userExists($connection)) { // change the password - $query = $connection->prepare("ALTER ROLE \"" . addslashes($this->dbUser) . "\" WITH CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); + $query = $connection->prepare("ALTER ROLE " . addslashes($this->dbUser) . " WITH CREATEDB 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) { |