From 896dbfaf675c4a91f2bc5a22fe2eac6f6461ec0f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 12 Mar 2009 14:59:36 +1300 Subject: fixed quoting of the table named "user" --- lib/featureduserssection.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/featureduserssection.php b/lib/featureduserssection.php index aed94b1a5..4b9238d47 100644 --- a/lib/featureduserssection.php +++ b/lib/featureduserssection.php @@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection $quoted[] = "'$nick'"; } + $table = "user"; + if(common_config('db','quote_identifiers')) { + $table = '"' . $table . '"'; + } + $qry = 'SELECT profile.* ' . - 'FROM profile JOIN user on profile.id = user.id ' . - 'WHERE user.nickname in (' . implode(',', $quoted) . ') ' . + 'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' . + 'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' . 'ORDER BY profile.created DESC '; $limit = PROFILES_PER_SECTION + 1; -- cgit v1.2.3-54-g00ecf