From bfabd20ae4a131e2e6be512775fc2ba30e3c7d45 Mon Sep 17 00:00:00 2001 From: GaryJones Date: Thu, 22 Nov 2012 16:25:34 +0000 Subject: [PATCH] Fix bug where the colon between host and port would appear, even when port was an empty string. --- src/GaryJones/OAuth/Request.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GaryJones/OAuth/Request.php b/src/GaryJones/OAuth/Request.php index 8b33d17..d98d15a 100644 --- a/src/GaryJones/OAuth/Request.php +++ b/src/GaryJones/OAuth/Request.php @@ -288,9 +288,11 @@ class Request // $host = (isset($parts['host'])) ? explode(':', $parts['host'])[0] : ''; $path = (isset($parts['path'])) ? $parts['path'] : ''; - if (($scheme == 'https' && $port != '443') - || ($scheme == 'http' && $port != '80')) { - $host = "$host:$port"; + if ($port) { + if (('https' == $scheme && $port != '443') + || ('http' == $scheme && $port != '80')) { + $host = "$host:$port"; + } } return "$scheme://$host$path"; }