From 18c8a55ba61e507f08162149273a9a33b9b73ca0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 17 Mar 2009 10:36:12 +1300 Subject: use common_database_tablename instead of repeating that if structure everywhere --- lib/util.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/util.php') 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 -- cgit v1.2.3-54-g00ecf