You are here

function _update_178_url_formats in Drupal 5

Same name and namespace in other branches
  1. 4 database/updates.inc \_update_178_url_formats()
2 calls to _update_178_url_formats()
system_update_178 in modules/system/system.install
Update base paths for relative URLs in node and comment content.
system_update_179 in modules/system/system.install
Update base paths for relative URLs in custom blocks, profiles and various variables.

File

modules/system/system.install, line 2815

Code

function _update_178_url_formats() {
  $formats = array();

  // Any format with the HTML filter in it
  $result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 0");
  while ($format = db_fetch_object($result)) {
    $formats[$format->format] = TRUE;
  }

  // Any format with only the linebreak filter in it
  $result = db_query("SELECT format FROM {filters} WHERE module = 'filter' AND delta = 2");
  while ($format = db_fetch_object($result)) {
    if (db_result(db_query('SELECT COUNT(*) FROM {filters} WHERE format = %d', $format->format)) == 1) {
      $formats[$format->format] = TRUE;
    }
  }

  // Any format with 'HTML' in its name
  $result = db_query("SELECT format FROM {filter_formats} WHERE name LIKE '%HTML%'");
  while ($format = db_fetch_object($result)) {
    $formats[$format->format] = TRUE;
  }
  return $formats;
}