]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow public access to the principals/system/public
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 19 Jul 2016 06:31:41 +0000 (08:31 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 26 Sep 2016 09:55:37 +0000 (11:55 +0200)
apps/dav/lib/DAV/PublicAuth.php

index 41fab614c3d4ec44070a4b6155f7169c2098dd12..3f5d37f1a69abfe406e84fcf795ac9440273e5f0 100644 (file)
@@ -34,7 +34,8 @@ class PublicAuth implements BackendInterface {
         */
        public function __construct() {
                $this->publicURLs = [
-                       'public-calendars'
+                       'public-calendars',
+                       'principals/system/public'
                ];
        }
 
@@ -82,7 +83,7 @@ class PublicAuth implements BackendInterface {
 
        /**
         * @param RequestInterface $request
-        * @return array
+        * @return bool
         */
        private function isRequestPublic(RequestInterface $request) {
                $params = $request->getQueryParameters();
@@ -93,6 +94,6 @@ class PublicAuth implements BackendInterface {
                $matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) {
                        return strpos($url, $publicUrl, 0) === 0;
                });
-               return $matchingUrls;
+               return !empty($matchingUrls);
        }
 }