? domain_port.patch
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.40.2.10
diff -u -p -r1.40.2.10 domain.module
--- domain.module	8 Jun 2008 15:42:16 -0000	1.40.2.10
+++ domain.module	24 Jun 2008 19:29:49 -0000
@@ -40,8 +40,8 @@ define('DOMAIN_SITE_GRANT', TRUE);
 function domain_init() {
   global $_domain, $conf;
   $_domain = array();
-  // Cribbed from bootstrap.inc -- removes port protocols from the host value.
-  $_subdomain = strtolower(implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
+  // We lower case this, since EXAMPLE.com == example.com.
+  $_subdomain = strtolower(rtrim($_SERVER['HTTP_HOST']));
 
   // Strip the www. off the subdomain, if required by the module settings.
   $raw_domain = $_subdomain;
Index: domain_conf/settings_domain_conf.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_conf/settings_domain_conf.inc,v
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.3 settings_domain_conf.inc
--- domain_conf/settings_domain_conf.inc	8 Jun 2008 15:24:58 -0000	1.4.2.3
+++ domain_conf/settings_domain_conf.inc	24 Jun 2008 19:29:49 -0000
@@ -31,8 +31,8 @@ function _domain_conf_load($domain = NUL
   $check = db_result(db_query("SELECT status FROM {system} WHERE name = 'domain_conf'"));
   if ($check > 0) {
     if (is_null($domain)) {
-      // Cribbed from bootstrap.inc -- removes port protocols from the host value.
-      $_subdomain = strtolower(implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
+      // We lower case this, since EXAMPLE.com == example.com.
+      $_subdomain = strtolower(rtrim($_SERVER['HTTP_HOST']));   
       // Lookup the active domain against our allowed hosts record.
       $domain = db_fetch_array(db_query("SELECT domain_id FROM {domain} WHERE subdomain = '%s'", $_subdomain));
     }
Index: domain_prefix/settings_domain_prefix.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_prefix/settings_domain_prefix.inc,v
retrieving revision 1.4.2.4
diff -u -p -r1.4.2.4 settings_domain_prefix.inc
--- domain_prefix/settings_domain_prefix.inc	18 Jun 2008 19:41:57 -0000	1.4.2.4
+++ domain_prefix/settings_domain_prefix.inc	24 Jun 2008 19:29:49 -0000
@@ -22,8 +22,8 @@ function _domain_prefix_load($domain = N
   $check = db_result(db_query("SELECT status FROM {system} WHERE name = 'domain_prefix'"));
   if ($check > 0) {
     if (is_null($domain)) {
-      // Cribbed from bootstrap.inc -- removes port protocols from the host value.
-      $_subdomain = strtolower(implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
+      // We lower case this, since EXAMPLE.com == example.com.
+      $_subdomain = strtolower(rtrim($_SERVER['HTTP_HOST']));    
       // Lookup the active domain against our allowed hosts record.
       $domain = db_fetch_array(db_query("SELECT domain_id FROM {domain} WHERE subdomain = '%s'", $_subdomain));      
     }
