summaryrefslogtreecommitdiffstats
path: root/lib/private/request.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-05 15:41:28 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-06 11:51:10 +0100
commitf8fe2753b125c6882019d1ba2c2db661b0bdcbf2 (patch)
tree724d072cea0df8c358ff6124fe8321997853d8d3 /lib/private/request.php
parent421cff00bdb6441b1639c83ed68dc1cbe196e333 (diff)
downloadnextcloud-server-f8fe2753b125c6882019d1ba2c2db661b0bdcbf2.tar.gz
nextcloud-server-f8fe2753b125c6882019d1ba2c2db661b0bdcbf2.zip
Added localhost as trusted domain
Diffstat (limited to 'lib/private/request.php')
-rwxr-xr-xlib/private/request.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/request.php b/lib/private/request.php
index fb387e83e3a..347d77b3724 100755
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -13,6 +13,8 @@ class OC_Request {
const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#';
const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#';
+ const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)(:[0-9]+|)$/';
+
/**
* @brief Check overwrite condition
* @param string $type
@@ -38,6 +40,9 @@ class OC_Request {
if (empty($trustedList)) {
return true;
}
+ if (preg_match(self::REGEX_LOCALHOST, $domain) === 1) {
+ return true;
+ }
return in_array($domain, $trustedList);
}