Commit 1d2828d3 authored by Robert Lyon's avatar Robert Lyon

Stripping the port number from noreplyaddress (Bug #1447892)

In case the site has port specified in its server['HOST'].

Change-Id: Ia033270487a14a537dada5697b8c2d3848d490fa
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent db835c19
...@@ -317,14 +317,8 @@ if ($CFG->sslproxy === false && isset($_SERVER['REMOTE_ADDR']) && (!isset($_SERV ...@@ -317,14 +317,8 @@ if ($CFG->sslproxy === false && isset($_SERVER['REMOTE_ADDR']) && (!isset($_SERV
parse_url($CFG->wwwroot, PHP_URL_SCHEME) === 'https'){ parse_url($CFG->wwwroot, PHP_URL_SCHEME) === 'https'){
redirect(get_relative_script_path()); redirect(get_relative_script_path());
} }
if (!isset($CFG->noreplyaddress) && isset($_SERVER['HTTP_HOST'])) { if (!isset($CFG->noreplyaddress) && isset($CFG->wwwroot)) {
$noreplyaddress = 'noreply@'; $noreplyaddress = 'noreply@' . parse_url($CFG->wwwroot, PHP_URL_HOST);
$host = (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
if (false !== strpos($host, ',')) {
list($host) = explode(',', $host);
$host = trim($host);
}
$noreplyaddress .= $host;
try { try {
set_config('noreplyaddress', $noreplyaddress); set_config('noreplyaddress', $noreplyaddress);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment