? non_standard_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	18 Jun 2008 19:44:28 -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'], '.')))));
+  // Removes port protocols from the host value.
+  $_subdomain = strtolower(preg_replace('/:[0-9]+$/', '', rtrim($_SERVER['HTTP_HOST'])));
 
   // Strip the www. off the subdomain, if required by the module settings.
   $raw_domain = $_subdomain;
@@ -576,7 +576,7 @@ function domain_get_path($domain) {
   if (substr($_url['path'], -1) != '/') {
     $_url['path'] .= '/';
   }
-  $path = $domain['scheme'] .'://'. $domain['subdomain'] . $_url['path'];
+  $path = $domain['scheme'] .'://'. $domain['subdomain'] . (isset($_url['port']) ? ':'. $_url['port'] : '') . $_url['path'];
   return $path;
 }
 
@@ -584,7 +584,7 @@ function domain_get_path($domain) {
  * Determine an absolute path to the current page
  */
 function domain_get_uri($domain) {
-  $path = $domain['scheme'] .'://'. $domain['subdomain'] . request_uri();
+  $path = $domain['path'] . drupal_get_path_alias($_GET['q']);
   return $path;
 }
 
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	18 Jun 2008 19:44:28 -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'], '.')))));
+      // Removes port protocols from the host value.
+      $_subdomain = strtolower(preg_replace('/:[0-9]+$/', '', 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	18 Jun 2008 19:44:28 -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'], '.')))));
+      // Removes port protocols from the host value.
+      $_subdomain = strtolower(preg_replace('/:[0-9]+$/', '', 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));      
     }
