FreeBSD Bugzilla – Attachment 181755 Details for
Bug 218628
[patch] www/baikal - backport support for <CARDDAV:prop> filtering in addressbook-query REPORTs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
baikal-vcard-props.diff.txt (text/plain), 4.97 KB, created by
Pietro Cerutti
on 2017-04-13 11:30:20 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Pietro Cerutti
Created:
2017-04-13 11:30:20 UTC
Size:
4.97 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 438429) >+++ Makefile (working copy) >@@ -3,7 +3,7 @@ > > PORTNAME= baikal > PORTVERSION= 0.4.6 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= www > MASTER_SITES= https://github.com/fruux/Baikal/releases/download/${PORTVERSION}/ > >Index: files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php >=================================================================== >--- files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php (nonexistent) >+++ files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php (working copy) >@@ -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 { >+ > >Property changes on: files/patch-vendor_sabre_dav_lib_CardDAV_Plugin.php >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php >=================================================================== >--- files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php (nonexistent) >+++ files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php (working copy) >@@ -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; >+ > >Property changes on: files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Filter_AddressData.php >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php >=================================================================== >--- files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php (nonexistent) >+++ files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php (working copy) >@@ -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 > >Property changes on: files/patch-vendor_sabre_dav_lib_CardDAV_Xml_Request_AddressBookQueryReport.php >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218628
: 181755