replace "=0D=0A" (\r\n) with a simple "\n" in vards during import

remotes/origin/stable45
Bjoern Schiessle 13 years ago
parent 18d19b022f
commit 1d493a70e7
  1. 4
      apps/contacts/import.php

@ -63,13 +63,13 @@ foreach($lines as $line){
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){ if(strtoupper(trim($line)) == 'BEGIN:VCARD'){
$inelement = true; $inelement = true;
} elseif (strtoupper(trim($line)) == 'END:VCARD') { } elseif (strtoupper(trim($line)) == 'END:VCARD') {
$card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); $card[] = str_replace('=0D=0A', '\n', iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line));
$parts[] = implode($nl, $card); $parts[] = implode($nl, $card);
$card = array(); $card = array();
$inelement = false; $inelement = false;
} }
if ($inelement === true && trim($line) != '') { if ($inelement === true && trim($line) != '') {
$card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); $card[] = str_replace('=0D=0A', '\n', iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line));
} }
} }
//import the contacts //import the contacts

Loading…
Cancel
Save