summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-10 10:48:13 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-10 10:48:13 -0400
commita0a6a627e7c8f036588a3e3488fb1c273e3815c4 (patch)
tree55f8b7e1bc390eb1b8515701ace3b30938c03df9 /lib
parent08c08d02aa48e492eb40ad3790e4fb05c2b86a91 (diff)
parent6cdc2ff444b8c76a3cdc5b8c6e9e7e7539d9b6cc (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib')
-rw-r--r--lib/featureduserssection.php9
-rw-r--r--lib/util.php13
2 files changed, 20 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;
diff --git a/lib/util.php b/lib/util.php
index b17a44bd8..675ff51f0 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1321,3 +1321,16 @@ function common_compatible_license($from, $to)
// XXX: better compatibility check needed here!
return ($from == $to);
}
+
+/**
+ * returns a quoted table name, if required according to config
+ */
+function common_database_tablename($tablename)
+{
+
+ if(common_config('db','quote_identifiers')) {
+ $tablename = '"'. $tablename .'"';
+ }
+ //table prefixes could be added here later
+ return $tablename;
+} \ No newline at end of file