From fe90903fa1ff59c0da278fee2ee6a0e1f6273a06 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 10 May 2019 21:08:18 +0200 Subject: [PATCH] Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744) Looks like \R is not allowed in character class, but \r\n is fine. On PHP 7.3.5 it throws warnings and empty result from preg_replace(), though I couldn't reproduce. --- CHANGELOG | 1 + program/lib/Roundcube/rcube_vcard.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8162aec60..d580649d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -35,6 +35,7 @@ CHANGELOG Roundcube Webmail - Fix bug where attachment preview didn't work with x_frame_options=deny (#6688) - Fix so bin/install-jsdeps.sh returns error code on error (#6704) - Fix bug where bmp images couldn't be displayed on some systems (#6728) +- Fix bug in parsing vCard data using PHP 7.3 due to an invalid regexp (#6744) RELEASE 1.4-rc1 --------------- diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index edc5a8c8b..0b6b5dfe7 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -538,8 +538,8 @@ class rcube_vcard '/item(\d+)\.(TEL|EMAIL|URL)([^:]*?):(.*?)item\1.X-ABLabel:(?:_\$!<)?([\w() -]*)(?:>!\$_)?./si', '/^item\d*\.X-AB.*$/mi', // remove cruft like item1.X-AB* '/^item\d*\./mi', // remove item1.ADR instead of ADR - '/\n+/', // remove empty lines - '/^(N:[^;\R]*)$/m', // if N doesn't have any semicolons, add some + '/\n+/', // remove empty lines + '/^(N:[^;\r\n]*)$/m', // if N doesn't have any semicolons, add some ), array( '\2;type=\5\3:\4',