--- subdomain.module.orig	2009-03-18 08:53:37.000000000 -0400
+++ subdomain.module	2009-07-31 16:06:46.000000000 -0400
@@ -69,7 +69,7 @@
       $type = node_get_types('type',$node);
       $type_name = strtolower($type->name);
       $type_title = strtolower($type->title_label);
-      if (module_exists('og') && og_is_group_type($node->type)) {
+      /*if (module_exists('og') && og_is_group_type($node->type)) {
         $node->title = trim($node->title);
 
         // Allow only letters, numbers, and spaces
@@ -97,7 +97,7 @@
             }
           }
         }
-      }
+      }*/
 
       // Disallow node titles that start with the subdomain token prefix character (else they'll be inadvertantly rewritten as subdomains)
       if (substr(trim($node->title), 0, strlen(SUBDOMAIN_TOKEN_PREFIX)) == SUBDOMAIN_TOKEN_PREFIX) {
@@ -107,7 +107,7 @@
 
     case 'load':
       if (module_exists('og') && og_is_group_type($node->type)) {
-        $node->subdomain = subdomain_raw_to_subdomain($node->title);
+        $node->subdomain = subdomain_raw_to_subdomain(db_result(db_query("SELECT title FROM {subdomain} WHERE nid = %d", $node->nid)));
       }
       break;
   }
@@ -159,11 +159,11 @@
       switch (variable_get('subdomain_type', SUBDOMAIN_USER)) {
         case SUBDOMAIN_GROUP:
           if (module_exists('og') && og_is_group_type($object->type)) {
-              $values['subdomain'] = subdomain_build_token($object->title, $object->nid);
+              $values['subdomain'] = subdomain_build_token(db_result(db_query("SELECT title FROM {subdomain} WHERE nid = %d", $object->nid)), $object->nid);
           }
           elseif (isset($object->og_groups)) {
             // 1st Group in og_groups array is used for subdomain
-            if ($groupname = db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $object->og_groups[0]))) {
+            if ($groupname = db_result(db_query("SELECT title FROM {subdomain} WHERE nid = %d", $object->og_groups[0]))) {
               $values['subdomain'] = subdomain_build_token($groupname, $object->og_groups[0]);
             };
           }
