Skip to content

Commit

Permalink
Loosen the check for port numbers in guessBaseHref. Fixes #796
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Sep 7, 2018
1 parent 14b681f commit 9bda271
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private function guessBaseHref()
$base_url = str_replace('/controller', '/', $base_url);
$protocol = filter_input(INPUT_SERVER, 'HTTPS', FILTER_SANITIZE_STRING) === null ? 'http' : 'https';
$port = filter_input(INPUT_SERVER, 'SERVER_PORT', FILTER_SANITIZE_STRING);
$disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$disp_port = ($port == 80 || $port == 443) ? '' : ":$port";
$domain = filter_input(INPUT_SERVER, 'SERVER_NAME', FILTER_SANITIZE_STRING);
$full_url = "$protocol://{$domain}{$disp_port}{$base_url}";
return $full_url;
Expand Down

0 comments on commit 9bda271

Please sign in to comment.