roundcube-plugin-carddav: fix bug with huge files

pkgsrc changes:
---------------
  * Fix bug when huge directories are fetched (Github #259)
  * Make standard the format of MESSAGE
  * Remove the inclusion of roundcube's Makefile.common
  * Install config.inc.php in EGDIR
This commit is contained in:
Frédéric Fauberteau 2020-02-11 13:25:57 +01:00
parent 6be580ceaa
commit 3c1a1c8887
4 changed files with 34 additions and 9 deletions

View File

@ -1,2 +1,7 @@
===========================================================================
$NetBSD: MESSAGE $
Add 'carddav' to the $rcmail_config['plugins'] array in
${PKG_SYSCONFDIR}/config.inc.php
===========================================================================

View File

@ -1,8 +1,5 @@
# $NetBSD: $
CONF_PLUGINS= carddav
.include "../../mail/roundcube/Makefile.common"
DISTNAME= carddav-3.0.3
PKGNAME= ${PHP_PKG_PREFIX}-roundcube-plugin-${DISTNAME}
CATEGORIES= mail
@ -16,24 +13,37 @@ MAINTAINER= triaxx@NetBSD.org
COMMENT= CardDAV adapter for Roundcube
LICENSE= gnu-gpl-v2
.include "../../mk/bsd.prefs.mk"
NO_BUILD= yes
DEPENDS+= ${PHP_PKG_PREFIX}-roundcube>=1.0.0:../../mail/roundcube
WRKSRC= ${WRKDIR}/carddav
DISTINFO_FILE= distinfo
PKG_SYSCONFSUBDIR= roundcube/plugins/carddav
PKG_SYSCONFSUBDIR= roundcube
WWW_USER?= ${APACHE_USER}
WWW_GROUP?= ${APACHE_GROUP}
PKG_GROUPS_VARS+= WWW_GROUP
PKG_USERS_VARS= WWW_USER
BUILD_DEFS+= WWW_USER WWW_GROUP APACHE_USER APACHE_GROUP
RCDIR= share/roundcube
CDDIR= ${RCDIR}/plugins/carddav
EGDIR= share/examples/roundcube/plugins/carddav
CD_SUBDIRS= dbmigrations localization skins vendor
.for d in ${CD_SUBDIRS}
INSTALLATION_DIRS+= ${CDDIR}/${d}
.endfor
INSTALLATION_DIRS+= ${EGDIR}
CONF_FILES_PERMS+= ${PREFIX}/${EGDIR}/plugins/carddav/config.inc.php \
${PKG_SYSCONFDIR}/config.inc.php \
CONF_FILES_PERMS+= ${PREFIX}/${EGDIR}/config.inc.php \
${PKG_SYSCONFDIR}/plugins/carddav/config.inc.php \
${WWW_USER} ${WWW_GROUP} 0640
MESSAGE_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
@ -63,7 +73,7 @@ do-install:
${DESTDIR}${PREFIX}/${CDDIR}/${i}
.endfor
${INSTALL_DATA} ${WRKSRC}/config.inc.php.dist \
${DESTDIR}${PREFIX}/${CDDIR}/config.inc.php.dist
${DESTDIR}${PREFIX}/${EGDIR}/config.inc.php
.include "../../lang/php/phpversion.mk"
.include "../../mk/bsd.pkg.mk"

View File

@ -4,4 +4,4 @@ SHA1 (carddav-3.0.3.tar.bz2) = 3e5174a179e8b2315474c16ba8917cc8c8eb2b9d
RMD160 (carddav-3.0.3.tar.bz2) = c7ac76272cab475c34f15bf5182e6d22d363429d
SHA512 (carddav-3.0.3.tar.bz2) = 718ff5c01c03f47c75262a407df1a1a7b73463f19ed89a32762bd16cceccd39247bb9ca03667fc38ab8c514d904550d2ce978f82d541c71b3ef6ffdf07390710
Size (carddav-3.0.3.tar.bz2) = 710891 bytes
SHA1 (patch-carddav__common.php) = a3054628234e676cbc53c37c03f5af49e48312e9
SHA1 (patch-carddav__common.php) = 43566dabbcf53e59e62d43356b7a8b63eecf423c

View File

@ -1,9 +1,19 @@
$NetBSD$
Change configuration file path from current directory to pkgsrc-compliant path.
* Fix issue with large CardDAV collection (Github #259).
* Make pkgsrc-compliant the path of configuration file.
--- carddav_common.php.orig 2018-10-01 07:23:22.000000000 +0000
+++ carddav_common.php
@@ -114,7 +114,7 @@ class carddav_common
if(!self::check_contenttype($reply['headers']['content-type'], ';(text|application)/xml;'))
return false;
- $xml = new SimpleXMLElement($reply['body']);
+ $xml = simplexml_load_string($reply['body'], 'SimpleXMLElement', LIBXML_COMPACT | LIBXML_PARSEHUGE);
$this->registerNamespaces($xml);
return $xml;
}
@@ -373,7 +373,7 @@ class carddav_common
$rcmail = rcmail::get_instance();