Skip to content

Commit

Permalink
Take into account SERVER_PORT when calculating WP_HOME
Browse files Browse the repository at this point in the history
See #101, #102
  • Loading branch information
gmazzap committed Nov 25, 2021
1 parent 73e66b2 commit 4c76d9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@
if (!defined('WP_HOME')) {
$home = filter_var($_SERVER['HTTPS'] ?? '', FILTER_VALIDATE_BOOLEAN) ? 'https://' : 'http://';
$home .= $_SERVER['SERVER_NAME'] ?? 'localhost';
$port = $_SERVER['SERVER_PORT'] ?? '';
(is_numeric($port) && (int)$port > 0) and $home .= sprintf(':%d', $port);
define('WP_HOME', $home);
unset($home);
}
Expand Down

0 comments on commit 4c76d9d

Please sign in to comment.