From: Mischa POSLAWSKY Date: Sun, 10 Feb 2019 08:23:52 +0000 (+0100) Subject: login/mailpass: strip www. subdomain from site domain X-Git-Tag: v3.9~13 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/519348de7aa1839fe208ecceca7386e1b9ff609d login/mailpass: strip subdomain from site domain Similar to contact mailer. --- diff --git a/login/mailpass.inc.php b/login/mailpass.inc.php index 5edc29e..2b0c204 100644 --- a/login/mailpass.inc.php +++ b/login/mailpass.inc.php @@ -21,7 +21,7 @@ function mailtoken($email) if (!file_put_contents("profile/$found/.token", $token)) throw new Exception("could not store token for $found"); - $sitename = $_SERVER['HTTP_HOST']; + $sitename = preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']); $sitelink = 'https://'.$sitename; $rep = [ '[[user]]' => $user->name ?: $found,