summaryrefslogtreecommitdiff
path: root/lib/mail.php
diff options
context:
space:
mode:
authorCiaran Gultnieks <ciaran@thurlow.(none)>2009-01-26 21:10:32 +0000
committerCiaran Gultnieks <ciaran@thurlow.(none)>2009-01-30 01:12:58 +0000
commit53274a6d9347c256430187a22347ca4a0910a395 (patch)
treeb7d412f4a75bf918cdebf31f9341f7c25fe96ffe /lib/mail.php
parenta4291d64cea2c9190ef190d85b4a858e111554e2 (diff)
PostgreSQL - code changes to avoid problems where user table is referenced in ad-hoc queries
Diffstat (limited to 'lib/mail.php')
-rw-r--r--lib/mail.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/mail.php b/lib/mail.php
index 1c6a10a8a..b424d579f 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -331,12 +331,13 @@ function mail_broadcast_notice_sms($notice)
$user = new User();
+ $UT = common_config('db','type')=='pgsql'?'"user"':'user';
$user->query('SELECT nickname, smsemail, incomingemail ' .
- 'FROM user JOIN subscription ' .
- 'ON user.id = subscription.subscriber ' .
+ "FROM $UT JOIN subscription " .
+ "ON $UT.id = subscription.subscriber " .
'WHERE subscription.subscribed = ' . $notice->profile_id . ' ' .
- 'AND user.smsemail IS NOT null ' .
- 'AND user.smsnotify = 1 ' .
+ "AND $UT.smsemail IS NOT null " .
+ "AND $UT.smsnotify = 1 " .
'AND subscription.sms = 1 ');
while ($user->fetch()) {