aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-01 08:55:12 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-01 08:55:12 +0200
commitda45fad3eb1ae0ef02b1cb30e238a29faaeecfa4 (patch)
treee18929629e814363f631ab59dea780ceb2d4d0ce /lib
parent8f05d4b662e2f0839af46c29ad0a7a4cad88d73a (diff)
parent4d23e060971d195da0c23cb00da297e581b6cffd (diff)
downloadnextcloud-server-da45fad3eb1ae0ef02b1cb30e238a29faaeecfa4.tar.gz
nextcloud-server-da45fad3eb1ae0ef02b1cb30e238a29faaeecfa4.zip
Merge pull request #17078 from owncloud/fix-initial-server-host
Fix undefined offset
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/http/request.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 7d6a49202c6..f826ef45bb5 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -659,11 +659,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @return string Server host
*/
public function getServerHost() {
- // FIXME: Ugly workaround that we need to get rid of
- if (\OC::$CLI && defined('PHPUNIT_RUN')) {
- return 'localhost';
- }
-
// overwritehost is always trusted
$host = $this->getOverwriteHost();
if ($host !== null) {
@@ -681,7 +676,11 @@ class Request implements \ArrayAccess, \Countable, IRequest {
return $host;
} else {
$trustedList = $this->config->getSystemValue('trusted_domains', []);
- return $trustedList[0];
+ if(!empty($trustedList)) {
+ return $trustedList[0];
+ } else {
+ return '';
+ }
}
}