svn: /web/php/trunk/include/ site.inc
| From: | Hannes Magnusson | Date: | Tue, 28 Dec 2010 11:42:50 +0000 |
| Subject: | svn: /web/php/trunk/include/ site.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-9907@lists.php.net to get a copy of this message | ||
bjori Tue, 28 Dec 2010 11:42:50 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=306785
Log:
Do not overwrite $MYSITE unless the new version actually exists
Changed paths:
U web/php/trunk/include/site.inc
Modified: web/php/trunk/include/site.inc
===================================================================
--- web/php/trunk/include/site.inc 2010-12-28 11:28:29 UTC (rev 306784)
+++ web/php/trunk/include/site.inc 2010-12-28 11:42:50 UTC (rev 306785)
@@ -375,10 +375,16 @@
// 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])) {