summaryrefslogtreecommitdiff
path: root/classes/Notice.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2009-07-15 20:23:52 +1200
committerBrenda Wallace <shiny@cpan.org>2009-07-15 20:23:52 +1200
commit788dd66dbe75db5d09c0cd5b33bb3347233cbd15 (patch)
treec8cd6d16040b78510a339524138439e584511012 /classes/Notice.php
parent3722b90a27b2fd53d77c60d51c53cc3e548ffcf9 (diff)
add quotes around table named "user" when quote_identifiers is true
Diffstat (limited to 'classes/Notice.php')
-rw-r--r--classes/Notice.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 4e244c666..8974e22f8 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -896,10 +896,14 @@ class Notice extends Memcached_DataObject
{
$user = new User();
+ if(common_config('db','quote_identifiers'))
+ $user_table = '"user"';
+ else $user_table = 'user';
+
$qry =
'SELECT id ' .
- 'FROM user JOIN subscription '.
- 'ON user.id = subscription.subscriber ' .
+ 'FROM '. $user_table .' JOIN subscription '.
+ 'ON '. $user_table .'.id = subscription.subscriber ' .
'WHERE subscription.subscribed = %d ';
$user->query(sprintf($qry, $this->profile_id));