From 2f76ad82507202353de804a6885db8e58ccc6106 Mon Sep 17 00:00:00 2001 From: ikkez Date: Thu, 2 May 2019 09:00:55 +0200 Subject: [PATCH] optimize code, #6 --- lib/opauth/OpauthBridge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/opauth/OpauthBridge.php b/lib/opauth/OpauthBridge.php index ad7ca8c..28af036 100644 --- a/lib/opauth/OpauthBridge.php +++ b/lib/opauth/OpauthBridge.php @@ -27,7 +27,8 @@ function __construct($config) { if (!isset($config['path'])) $config['path'] = $f3->BASE.'/'.$config['auth_route'].'/'; if (!isset($config['callback_url'])) - $config['callback_url'] = $f3->SCHEME.'://'.$f3->HOST.($f3->PORT?':'.$f3->PORT:'').$f3->BASE.'/'. + $config['callback_url'] = $f3->SCHEME.'://'.$f3->HOST. + ($f3->PORT && !in_array($f3->PORT,[80,443])?(':'.$f3->PORT):'').$f3->BASE.'/'. $config['callback_route']; if (!isset($config['callback_transport'])) $config['callback_transport'] = 'post';