Skip to content

Commit 5845c4e

Browse files
committed
Fix get_forwarded_host() when HTTP_X_FORWARDED_HOST is defined
1 parent 4e59345 commit 5845c4e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

includes/Forwarded_URLs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ private function has_forwarded_host() {
135135
public function get_forwarded_host() {
136136

137137
// are we using Forward HQ?
138-
$host = isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : false;
138+
$host = isset( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'];
139139

140140
// if not, check if we're using ngrok
141-
$host = ! $host && isset( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) ? $_SERVER['HTTP_X_ORIGINAL_HOST'] : $_SERVER['HTTP_HOST'];
141+
$host = isset( $_SERVER['HTTP_X_ORIGINAL_HOST'] ) ? $_SERVER['HTTP_X_ORIGINAL_HOST'] : $host;
142142

143143
return $host;
144144
}

0 commit comments

Comments
 (0)