From: Brenda Wallace Date: Wed, 15 Jul 2009 08:23:52 +0000 (+1200) Subject: add quotes around table named "user" when quote_identifiers is true X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=788dd66dbe75db5d09c0cd5b33bb3347233cbd15;p=quix0rs-gnu-social.git add quotes around table named "user" when quote_identifiers is true --- diff --git a/classes/Notice.php b/classes/Notice.php index 4e244c6661..8974e22f83 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));