From 1fe4c9a29359b4a5caad1e262eecde33379d6875 Mon Sep 17 00:00:00 2001 From: Pepijn Over Date: Mon, 28 Jul 2014 09:00:12 +0200 Subject: [PATCH] issue #111: non-default ports should always be included in the HTTP "Host" header, so should not be added again when building urls. --- CHANGELOG.rst | 1 + src/includes/functions.inc.php | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 20588757..021c7df9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,7 @@ not yet released * #103: Added Russian translation. * #105: Fixing check for websites with unverified SSL certificates. * #107: Fixing update job for Synology DSM Task Scheduler. +* #111: Generated urls for non-default ports included the port twice. * Support for Danish SMS provider Smsit * Composer added for dependencies. diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 84a0eb21..ec004b98 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -463,11 +463,7 @@ function psm_build_sms() { * @return string */ function psm_build_url($params = array(), $urlencode = true, $htmlentities = true) { - $defports = array(80, 443); $url = ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; - if(!in_array($_SERVER['SERVER_PORT'], $defports)) { - $url .= ':' . $_SERVER['SERVER_PORT']; - } $url .= dirname($_SERVER['SCRIPT_NAME']) . '/'; if($params != null) {