summaryrefslogtreecommitdiffstats
path: root/lib/request.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-01 23:51:43 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-01 23:51:43 +0200
commit7d7a2ce31725518084e09ae32bc74533732909ba (patch)
tree6ee0b24c01cdb37c05cb96bdcb17b76ffd1e341c /lib/request.php
parent383e4c62b578996b343b540e03c7afed61be644e (diff)
downloadnextcloud-server-7d7a2ce31725518084e09ae32bc74533732909ba.tar.gz
nextcloud-server-7d7a2ce31725518084e09ae32bc74533732909ba.zip
use $_SERVER['SERVER_NAME'] in case $_SERVER['HTTP_HOST'] is not set
Diffstat (limited to 'lib/request.php')
-rwxr-xr-xlib/request.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/request.php b/lib/request.php
index aa5f53c08eb..df33217f95d 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -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;
}