Commit:    191ca694f73ef81b6b9a8365d06031320b04e555
Author:    Hannes Magnusson <[email protected]>         Tue, 28 Dec 2010 11:42:50 
+0000
Parents:   b310ac928eb45a0a5efea1ed78e6d618664f889c
Branches:  master

Link:       
http://git.php.net/?p=web/php.git;a=commitdiff;h=191ca694f73ef81b6b9a8365d06031320b04e555

Log:
Do not overwrite $MYSITE unless the new version actually exists

Changed paths:
  M  include/site.inc


Diff:
diff --git a/include/site.inc b/include/site.inc
index d465730..6cc0911 100644
--- a/include/site.inc
+++ b/include/site.inc
@@ -375,10 +375,16 @@ if (!isset($MIRRORS[$MYSITE])) {
     // the browser (in the Host HTTP header).
  
     if($_SERVER["SERVER_PORT"] != '80') {
-        $MYSITE = 'http://' . preg_replace("!^www\\.!", "", 
$_SERVER["SERVER_NAME"]) . ':' . (int)$_SERVER["SERVER_PORT"] . '/'; 
+        $tmp = 'http://' . preg_replace("!^www\\.!", "", 
$_SERVER["SERVER_NAME"]) . ':' . (int)$_SERVER["SERVER_PORT"] . '/'; 
     } else {
-        $MYSITE = 'http://' . preg_replace("!^www\\.!", "", 
$_SERVER["SERVER_NAME"]) . '/';
+        $tmp = 'http://' . preg_replace("!^www\\.!", "", 
$_SERVER["SERVER_NAME"]) . '/';
     }
+
+    // If the name without www. exists, use it
+    if (isset($MIRRORS[$tmp])) {
+        $MYSITE = $tmp;
+    }
+
     // If the mirror is not registered with this name, provide defaults
     // (no country code, no search, no stats, English default language ...)
     if (!isset($MIRRORS[$MYSITE])) {


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to