[pLog-svn] r6974 - plog/branches/lifetype-1.2/class/net/http

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Feb 3 09:39:08 EST 2010


Author: jondaley
Date: 2010-02-03 09:39:07 -0500 (Wed, 03 Feb 2010)
New Revision: 6974

Modified:
   plog/branches/lifetype-1.2/class/net/http/subdomains.class.php
Log:
need to test this some more, but I think this makes www. prefixes 'just work'.  And there isn't a use-case for having different content with a www. prefix, is there?

Modified: plog/branches/lifetype-1.2/class/net/http/subdomains.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/http/subdomains.class.php	2010-01-30 18:10:42 UTC (rev 6973)
+++ plog/branches/lifetype-1.2/class/net/http/subdomains.class.php	2010-02-03 14:39:07 UTC (rev 6974)
@@ -53,12 +53,18 @@
 			// and now get the base_url
 			$config =& Config::getConfig();
 			$baseUrlObject = new Url( $config->getValue( "base_url" ));
-			
+
+                // ignore "www." prefixes - that doesn't make it a subdomain
+            $base = preg_replace("/^www./", "", $baseUrlObject->getHost());
+            $current = preg_replace("/^www./", "", $urlObject->getHost());
+
 			// and finally check if whether they match or not
-			if( $urlObject->getHost() == $baseUrlObject->getHost())
+			if($base == $current){
 				$isSubdomain = false;
-			else
+            }
+            else{
 				$isSubdomain = true;
+            }
 			
 			// return it...
 			return( $isSubdomain );



More information about the pLog-svn mailing list