From d4de692822269f255d5fa345b969dc92e327afaa Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 12 Jul 2013 07:38:21 +0100 Subject: [PATCH] Replace www. in settingsFile name Means both www. and blank subdomains share the same file --- lib/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/settings.php b/lib/settings.php index 2e74907..4d2762a 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -91,7 +91,7 @@ $configUsersTemplate = 'config___users-template.php'; $username = ""; if (isset($_POST['username']) && $_POST['username'] != "") {$username = strClean($_POST['username']."-");}; if (isset($_SESSION['username']) && $_SESSION['username'] != "") {$username = strClean($_SESSION['username']."-");}; -$settingsFile = 'config-'.$username.str_replace(".","_",$_SERVER['SERVER_NAME']).'.php'; +$settingsFile = 'config-'.$username.str_replace(".","_",str_replace("www.","",$_SERVER['SERVER_NAME'])).'.php'; $setPWorLogin = "login"; if (!file_exists(dirname(__FILE__)."/".$settingsFile)) { if (!copy(dirname(__FILE__)."/".$configUsersTemplate, dirname(__FILE__)."/".$settingsFile)) {