From 969cfd362c1dbb9d3cb719f0f63496bf33857ba4 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 11 Apr 2022 09:09:37 -0400 Subject: [PATCH] fix(addressbook): handle LDIF file with a single contact when importing --- UI/Contacts/UIxContactFolderActions.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index 74df23055..bd5a5ef6b 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2006-2021 Inverse inc. + Copyright (C) 2006-2022 Inverse inc. This file is part of SOGo @@ -206,7 +206,9 @@ static NSArray *photoTags = nil; continue; } - if (j == 0) + if (j == 0 && ![line hasPrefix: @"dn:"]) + // Because we splitted contacts on " + dn", we need to restore the dn prefix, + // unless it's the first contact of the file, in which case it still has the dn prefix. line = [NSString stringWithFormat: @"dn%@", line]; /* handle continuation lines */