]> source.dussan.org Git - nextcloud-server.git/commitdiff
Added localhost as trusted domain
authorVincent Petry <pvince81@owncloud.com>
Wed, 5 Mar 2014 14:41:28 +0000 (15:41 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 6 Mar 2014 10:51:10 +0000 (11:51 +0100)
lib/private/request.php

index fb387e83e3ac426b79941634501a74d10c77fc37..347d77b37241d1d903413ac49639d1d446969a8a 100755 (executable)
@@ -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);
        }