From owner-svn-ports-head@freebsd.org Thu Apr 13 11:39:30 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A60D3B6FA; Thu, 13 Apr 2017 11:39:30 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6F3F0A; Thu, 13 Apr 2017 11:39:30 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3DBdTfK000366; Thu, 13 Apr 2017 11:39:29 GMT (envelope-from gahr@FreeBSD.org) Received: (from gahr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3DBdTo4000362; Thu, 13 Apr 2017 11:39:29 GMT (envelope-from gahr@FreeBSD.org) Message-Id: <201704131139.v3DBdTo4000362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gahr set sender to gahr@FreeBSD.org using -f From: Pietro Cerutti Date: Thu, 13 Apr 2017 11:39:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r438437 - in head/www/baikal: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 11:39:30 -0000 Author: gahr Date: Thu Apr 13 11:39:28 2017 New Revision: 438437 URL: https://svnweb.freebsd.org/changeset/ports/438437 Log: www/baikal: backport prop filtering in addressbook-query REPORTs Also, take maintainership. PR: 218628 Submitted by: gahr Approved by: mat (maintainer) Obtained from: https://github.com/fruux/sabre-dav/pull/910 Added: head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php (contents, props changed) head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php (contents, props changed) head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php (contents, props changed) Modified: head/www/baikal/Makefile Modified: head/www/baikal/Makefile ============================================================================== --- head/www/baikal/Makefile Thu Apr 13 10:17:08 2017 (r438436) +++ head/www/baikal/Makefile Thu Apr 13 11:39:28 2017 (r438437) @@ -3,17 +3,17 @@ PORTNAME= baikal PORTVERSION= 0.4.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= https://github.com/fruux/Baikal/releases/download/${PORTVERSION}/ -MAINTAINER= mat@FreeBSD.org +MAINTAINER= gahr@FreeBSD.org COMMENT= Lightweight CalDAV/CardDAV server LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE -USES= php zip +USES= php zip USE_PHP= ctype dom filter json mbstring openssl pdo_sqlite session xml xmlreader xmlwriter WRKSRC= ${WRKDIR}/${PORTNAME} Added: head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php Thu Apr 13 11:39:28 2017 (r438437) @@ -0,0 +1,38 @@ +--- vendor/sabre/dav/lib/CardDAV/Plugin.php.orig 2017-04-13 09:06:24 UTC ++++ vendor/sabre/dav/lib/CardDAV/Plugin.php +@@ -450,7 +450,8 @@ class Plugin extends DAV\ServerPlugin { + + $props[200]['{' . self::NS_CARDDAV . '}address-data'] = $this->convertVCard( + $props[200]['{' . self::NS_CARDDAV . '}address-data'], +- $vcardType ++ $vcardType, ++ $report->addressDataProperties + ); + + } +@@ -807,12 +808,24 @@ class Plugin extends DAV\ServerPlugin { + * @param string $target + * @return string + */ +- protected function convertVCard($data, $target) { ++ protected function convertVCard($data, $target, array $propertiesFilter = null) { + + if (is_resource($data)) { + $data = stream_get_contents($data); + } + $input = VObject\Reader::read($data); ++ if (!empty($propertiesFilter)) { ++ $propertiesFilter = array_merge(['UID', 'VERSION', 'FN'], $propertiesFilter); ++ $keys = array_unique(array_map(function($child) { ++ return $child->name; ++ }, $input->children())); ++ $keys = array_diff($keys, $propertiesFilter); ++ $str = ""; ++ foreach ($keys as $key) { ++ unset($input->$key); ++ } ++ $data = $input->serialize(); ++ } + $output = null; + try { + Added: head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php Thu Apr 13 11:39:28 2017 (r438437) @@ -0,0 +1,14 @@ +--- vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php.orig 2017-04-13 09:07:03 UTC ++++ vendor/sabre/dav/lib/CardDAV/Xml/Filter/AddressData.php +@@ -51,6 +51,11 @@ class AddressData implements XmlDeserial + 'version' => $reader->getAttribute('version') ?: '3.0', + ]; + ++ $elems = (array)$reader->parseInnerTree(); ++ $result['addressDataProperties'] = array_map(function($element) { ++ return $element['attributes']['name']; ++ }, $elems); ++ + $reader->next(); + return $result; + Added: head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/baikal/files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php Thu Apr 13 11:39:28 2017 (r438437) @@ -0,0 +1,16 @@ +--- vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php.orig 2017-04-13 09:07:30 UTC ++++ vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php +@@ -29,6 +29,13 @@ class AddressBookQueryReport implements + public $properties; + + /** ++ * An array with requested vcard properties. ++ * ++ * @var array ++ */ ++ public $addressDataProperties = []; ++ ++ /** + * List of property/component filters. + * + * This is an array with filters. Every item is a property filter. Every