svn commit: r438437 - in head/www/baikal: . files
Pietro Cerutti
gahr at FreeBSD.org
Thu Apr 13 11:39:30 UTC 2017
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 at FreeBSD.org
+MAINTAINER= gahr at 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
More information about the svn-ports-all
mailing list