From: Brenda Wallace Date: Thu, 12 Mar 2009 01:59:36 +0000 (+1300) Subject: fixed quoting of the table named "user" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=896dbfaf675c4a91f2bc5a22fe2eac6f6461ec0f;p=quix0rs-gnu-social.git fixed quoting of the table named "user" --- diff --git a/lib/featureduserssection.php b/lib/featureduserssection.php index aed94b1a55..4b9238d471 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;