@@ 188-194 (lines=7) @@ | ||
185 | // |
|
186 | // Fix if phpMyFAQ is running behind a proxy server |
|
187 | // |
|
188 | if (! isset($_SERVER['HTTP_HOST'])) { |
|
189 | if (isset($_SERVER['HTTP_X_FORWARDED_SERVER'])) { |
|
190 | $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_SERVER']; |
|
191 | } else { |
|
192 | $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
193 | }; |
|
194 | } |
|
195 | ||
196 | // |
|
197 | // Fix undefined server variables in Windows IIS & CGI mode |
@@ 713-717 (lines=5) @@ | ||
710 | public static function getServerName() |
|
711 | { |
|
712 | $hostname = 'localhost.localdomain'; |
|
713 | if (isset($_SERVER['HTTP_HOST'])) { |
|
714 | $hostname = $_SERVER['HTTP_HOST']; |
|
715 | } else if (isset($_SERVER['SERVER_NAME'])) { |
|
716 | $hostname = $_SERVER['SERVER_NAME']; |
|
717 | } |
|
718 | ||
719 | return $hostname; |
|
720 | } |