Make it possible to import files using CR as eol.

remotes/origin/stable5
Thomas Tanghus 13 years ago
parent 334257d2b6
commit dc8193fccb
  1. 5
      apps/contacts/import.php

@ -12,6 +12,7 @@ OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('contacts'); OCP\App::checkAppEnabled('contacts');
session_write_close(); session_write_close();
$cr = "\r";
$nl = "\n"; $nl = "\n";
global $progresskey; global $progresskey;
@ -56,6 +57,10 @@ if(isset($_POST['method']) && $_POST['method'] == 'new'){
//analyse the contacts file //analyse the contacts file
writeProgress('40'); writeProgress('40');
$lines = explode($nl, $file); $lines = explode($nl, $file);
if(count($lines) == 1) { // Mac eol
$lines = explode($cr, $file);
}
$inelement = false; $inelement = false;
$parts = array(); $parts = array();
$card = array(); $card = array();

Loading…
Cancel
Save