From 6d8bfaeaeca7f8a01640a958e4622c637c4871b0 Mon Sep 17 00:00:00 2001 From: Weby Date: Thu, 27 Dec 2018 18:06:23 +0100 Subject: [PATCH] Repairing BASE64 encoded vCard version 3 Signed-off-by: Weby --- sabre/vobject/lib/Property.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sabre/vobject/lib/Property.php b/sabre/vobject/lib/Property.php index 3d1775fa2..b589a40c8 100644 --- a/sabre/vobject/lib/Property.php +++ b/sabre/vobject/lib/Property.php @@ -617,6 +617,18 @@ function validate($options = 0) { break; case Document::VCARD30 : $allowedEncoding = ['B']; + //Repair vCard30 that use BASE64 encoding + if ($options & self::REPAIR) { + if ('BASE64' === strtoupper($encoding)) { + $encoding = 'B'; + $this['ENCODING'] = $encoding; + $warnings[] = [ + 'level' => 1, + 'message' => 'ENCODING=BASE64 has been transformed to ENCODING=B.', + 'node' => $this, + ]; + } + } break; }