Index: core/filter.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/install_profile_api/core/Attic/filter.inc,v
retrieving revision 1.1.2.4.2.3
diff -u -p -r1.1.2.4.2.3 filter.inc
--- core/filter.inc	5 Aug 2009 22:14:53 -0000	1.1.2.4.2.3
+++ core/filter.inc	15 Feb 2010 09:54:48 -0000
@@ -109,3 +109,23 @@ function install_set_filter($format_id, 
     db_query("INSERT INTO {filters} (`format`, `module`, `delta`, `weight`) VALUES (%d, '%s', %d, %d)", $format_id, $module, $delta, $weight);
   }
 }
+
+/**
+ * Returns the filter format ID for a given format name.
+ *
+ * Note, filter formats 1 and 2 should be retrieved using the filter module
+ * constants FILTER_HTML_STRIP and FILTER_HTML_ESCAPE.
+ *
+ * @param $name
+ *   The name of a filter format.
+ * @return $index
+ *   The ID of the given filter format name.
+ */
+function install_get_format_id($name) {
+  static $formats = array();
+  if (empty($formats[$name])) {
+    $formats[$name] = db_result(db_query_range("SELECT format FROM {filter_formats} WHERE name ='%s'", $name, 0, 1));
+  }
+  return $formats[$name];
+}
+
