summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiaranG <ciaran@ciarang.com>2008-09-15 03:02:56 -0400
committerCiaranG <ciaran@ciarang.com>2008-09-15 03:02:56 -0400
commitab68c61a1212bca02686d54615d34699a853bb63 (patch)
treefc4317ce5653bad889a3578a70ced9a23921f491
parent3632a76773dbfc31cf6f99ad831bf13f793871ae (diff)
PostgreSQL: Quote table name in manually formed query - fixes profile settings update
darcs-hash:20080915070256-f6e2c-344d1ca1ca158b9ab5f558804ad129c1ef9d6a7a.gz
-rw-r--r--classes/User.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/classes/User.php b/classes/User.php
index 96a7482ea..cef4769f3 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);
}