From: CiaranG Date: Mon, 15 Sep 2008 07:02:56 +0000 (-0400) Subject: PostgreSQL: Quote table name in manually formed query - fixes profile settings update X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab68c61a1212bca02686d54615d34699a853bb63;p=quix0rs-gnu-social.git PostgreSQL: Quote table name in manually formed query - fixes profile settings update darcs-hash:20080915070256-f6e2c-344d1ca1ca158b9ab5f558804ad129c1ef9d6a7a.gz --- diff --git a/classes/User.php b/classes/User.php index 96a7482ead..cef4769f33 100644 --- a/classes/User.php +++ b/classes/User.php @@ -101,7 +101,12 @@ class User extends DB_DataObject return true; } $toupdate = implode(', ', $parts); - $qry = 'UPDATE ' . $this->tableName() . ' SET ' . $toupdate . + + $table = $this->tableName(); + if(common_config('db','quote_identifiers')) { + $table = '"' . $table . '"'; + } + $qry = 'UPDATE ' . $table . ' SET ' . $toupdate . ' WHERE id = ' . $this->id; return $this->query($qry); }