From e783d01da7b5209a4d3bfdb255573b4fc7fbe73c Mon Sep 17 00:00:00 2001
From: Thomas Müller <thomas.mueller@tmit.eu>
Date: Tue, 19 Jul 2016 08:31:41 +0200
Subject: Allow public access to the principals/system/public

---
 apps/dav/lib/DAV/PublicAuth.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'apps')

diff --git a/apps/dav/lib/DAV/PublicAuth.php b/apps/dav/lib/DAV/PublicAuth.php
index 41fab614c3d..3f5d37f1a69 100644
--- a/apps/dav/lib/DAV/PublicAuth.php
+++ b/apps/dav/lib/DAV/PublicAuth.php
@@ -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);
 	}
 }
-- 
cgit v1.2.3