--- modules/taxonomy/taxonomy.pages.inc	Tue Nov 23 02:56:10 2010
+++ modules/taxonomy/taxonomy.pagesNew.inc	Tue Feb 15 09:34:12 2011
@@ -113,7 +113,14 @@
       ->execute()
       ->fetchAllKeyed();
 
-    $prefix = count($tags_typed) ? implode(', ', $tags_typed) . ', ' : '';
+    $prefix = '';
+    if ($tags_typed && is_array($tags_typed)) {
+      foreach ($tags_typed as $tag_typed)
+        if (strpos($tag_typed, ',') !== FALSE || strpos($tag_typed, '"') !== FALSE) {
+          $tag_typed = '"'. str_replace('"', '""', $tag_typed) .'"';
+        $prefix .= $tag_typed . ', ';
+      }
+    }
 
     $term_matches = array();
     foreach ($tags_return as $tid => $name) {
