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

This commit is contained in:
Bjoern Schiessle 2012-06-11 18:13:12 +02:00
parent 18d19b022f
commit 1d493a70e7
1 changed files with 2 additions and 2 deletions

View File

@ -63,13 +63,13 @@ foreach($lines as $line){
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){
$inelement = true;
} 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);
$card = array();
$inelement = false;
}
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