Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-02 01:51:43 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-03 00:27:52 +0400
commit9532859e4dafdeadd2c9bd0aab4f3bbc1c222c0c (patch)
treebfc8ffacd32c29749736779b5a2eafb37b1f2292 /lib/request.php
parent61c569c76a136ce5f467aa7dfda5c36f76a61ac2 (diff)
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 2f94da13548..24a118b8b40 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() {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
@@ -39,7 +39,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;
}