Skip to content
Snippets Groups Projects
Commit 7d7a2ce3 authored by Thomas Müller's avatar Thomas Müller
Browse files

use $_SERVER['SERVER_NAME'] in case $_SERVER['HTTP_HOST'] is not set

parent 383e4c62
Branches
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
class OC_Request {
/**
* @brief Check overwrite condition
* @returns true/false
* @returns bool
*/
private static function isOverwriteCondition($type = '') {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
......@@ -40,7 +40,13 @@ class OC_Request {
}
}
else{
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
if (isset($_SERVER['HTTP_HOST'])) {
return $_SERVER['HTTP_HOST'];
}
if (isset($_SERVER['SERVER_NAME'])) {
return $_SERVER['SERVER_NAME'];
}
return 'localhost';
}
return $host;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment