]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make it possible to import files using CR as eol.
authorThomas Tanghus <thomas@tanghus.net>
Sun, 8 Jul 2012 16:28:55 +0000 (18:28 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Sun, 8 Jul 2012 16:34:00 +0000 (18:34 +0200)
apps/contacts/import.php

index b2c55bd42ace9839b97d4cce8754e26db6ebb979..85d4cebeb02299c049dcef941db99ab11c5490a3 100644 (file)
@@ -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;