From 403bb38bcd191d7b4e9c62e7f5f4bbb3968729df Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 27 Jun 2009 10:29:02 +1200 Subject: used single quotes in SQL --- classes/Notice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index 08125cf7b..4e244c666 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -873,7 +873,7 @@ class Notice extends Memcached_DataObject if ($cnt > 0) { $qry .= ', '; } - $qry .= '('.$id.', '.$this->id.', '.$source.', "'.$this->created.'") '; + $qry .= '('.$id.', '.$this->id.', '.$source.", '".$this->created. "') "; $cnt++; if ($cnt >= MAX_BOXCARS) { $inbox = new Notice_inbox(); -- cgit v1.2.3-54-g00ecf From 788dd66dbe75db5d09c0cd5b33bb3347233cbd15 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Wed, 15 Jul 2009 20:23:52 +1200 Subject: add quotes around table named "user" when quote_identifiers is true --- classes/Notice.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'classes/Notice.php') 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)); -- cgit v1.2.3-54-g00ecf