From: pdontthink Date: Wed, 21 Jul 2010 07:06:12 +0000 (+0000) Subject: Fix issues caused by use of PostgreSQL keyword 'user' in SquirrelMail's default prefe... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=865050ce6daedb8dbbbb568a36e802b0b6459565;p=squirrelmail.git Fix issues caused by use of PostgreSQL keyword 'user' in SquirrelMail's default preferences database schema (#2943483) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13963 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/doc/ChangeLog b/doc/ChangeLog index e4b5f4e3..334c5b2d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -344,7 +344,9 @@ Version 1.5.2 - SVN (reduces chances of session data growing too large) - Fixed minor vulnerability in Mail Fetch plugin [CVE-2010-1637/TEHTRI-SA-2010-009] - Now properly quote personal part of encoded addresses when replying. - - Now fill in default subject when forwarding as attachment (#2936541) + - Now fill in default subject when forwarding as attachment (#2936541). + - Fix issues caused by use of PostgreSQL keyword "user" in SquirrelMail's + default preferences database schema (#2943483). Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/db_prefs.php b/functions/db_prefs.php index c5f9e474..fc64be50 100644 --- a/functions/db_prefs.php +++ b/functions/db_prefs.php @@ -222,6 +222,14 @@ class dbPrefs { if (!empty($prefs_user_field)) { $this->user_field = $prefs_user_field; } + + // the default user field is "user", which in PostgreSQL + // is an identifier and causes errors if not escaped + // + if ($this->db_type == SMDB_PGSQL) { + $this->user_field = '"' . $this->user_field . '"'; + } + if (!empty($prefs_key_field)) { $this->key_field = $prefs_key_field; }