]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Merge branch '0.7.x' into 0.8.x
[quix0rs-gnu-social.git] / lib / util.php
index 78b5a36f87dc6affdfade10a9f5a856777b0f5f8..88876554824d83b74250acfae3ea82c57ffcae27 100644 (file)
@@ -1152,7 +1152,7 @@ function common_accept_to_prefs($accept, $def = '*/*')
 
     foreach($parts as $part) {
         // FIXME: doesn't deal with params like 'text/html; level=1'
-        @list($value, $qpart) = explode(';', $part);
+        @list($value, $qpart) = explode(';', trim($part));
         $match = array();
         if(!isset($qpart)) {
             $prefs[$value] = 1;
@@ -1379,3 +1379,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;
+}