You are here

function domain_update_6206 in Domain Access 6.2

Remove UPPERCASE from domain records.

@link http://drupal.org/node/785818

File

./domain.install, line 232
Install file.

Code

function domain_update_6206() {
  $ret = array();
  $result = db_query("SELECT domain_id, subdomain FROM {domain}");
  while ($domain = db_fetch_array($result)) {
    $string = drupal_strtolower($domain['subdomain']);
    if ($string != $domain['subdomain']) {
      db_query("UPDATE {domain} SET subdomain = '%s' WHERE domain_id = %d", $string, $domain['domain_id']);
      if ($domain['domain_id'] == 0) {
        variable_set('domain_root', $string);
      }
    }
  }
  return $ret;
}