summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2009-03-17 10:36:12 +1300
committerBrenda Wallace <shiny@cpan.org>2009-03-17 10:36:12 +1300
commit18c8a55ba61e507f08162149273a9a33b9b73ca0 (patch)
tree4449dd8c19363747ff88dcb5d922d7b1149be055 /lib
parentc2e529c72b17b61f2203466b2bfd73f07b8371f0 (diff)
use common_database_tablename instead of repeating that if structure everywhere
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 6341438ca..19637d546 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1300,3 +1300,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