login/mailpass: strip www. subdomain from site domain
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 10 Feb 2019 08:23:52 +0000 (09:23 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sun, 10 Feb 2019 08:23:52 +0000 (09:23 +0100)
Similar to contact mailer.

login/mailpass.inc.php

index 5edc29e524f4099a4067dd20d55cb8b23d3845e3..2b0c204915f20e7fe9f079734d098b73e724c81e 100644 (file)
@@ -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,