From 197086a9529b4a4ae778b252248fdffcd7b93c40 Mon Sep 17 00:00:00 2001
From: Thomas Tanghus <thomas@tanghus.net>
Date: Sun, 8 Jul 2012 18:28:55 +0200
Subject: [PATCH] Make it possible to import files using CR as eol.

---
 apps/contacts/import.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/apps/contacts/import.php b/apps/contacts/import.php
index b2c55bd42a..85d4cebeb0 100644
--- a/apps/contacts/import.php
+++ b/apps/contacts/import.php
@@ -10,6 +10,9 @@ ob_start();
  
 OCP\JSON::checkLoggedIn();
 OCP\App::checkAppEnabled('contacts');
+session_write_close();
+
+$cr = "\r";
 $nl = "\n";
 $progressfile = 'import_tmp/' . md5(session_id()) . '.txt';
 
@@ -52,6 +55,10 @@ writeProgress('20');
 $searchfor = array('VCARD');
 $parts = $searchfor;
 $filearr = explode($nl, $file);
+if(count($filearr) == 1) { // Mac eol
+	$filearr = explode($cr, $file);
+}
+
 $inelement = false;
 $parts = array();
 $i = 0;
-- 
GitLab