| @@ 197-203 (lines=7) @@ | ||
| 194 | // |
|
| 195 | // Fix if phpMyFAQ is running behind a proxy server |
|
| 196 | // |
|
| 197 | if (! isset($_SERVER['HTTP_HOST'])) { |
|
| 198 | if (isset($_SERVER['HTTP_X_FORWARDED_SERVER'])) { |
|
| 199 | $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_SERVER']; |
|
| 200 | } else { |
|
| 201 | $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST']; |
|
| 202 | }; |
|
| 203 | } |
|
| 204 | ||
| 205 | // |
|
| 206 | // 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 | } |
|