Aleksander Machniak
2013-06-28 7045bb9c07d31b6de5f2578d9a9f9971fc39f1cf
program/lib/Roundcube/rcube_csv2vcard.php
@@ -304,7 +304,6 @@
    {
        // convert to UTF-8
        $head     = substr($csv, 0, 4096);
        $fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1'); // fallback to Latin-1?
        $charset  = rcube_charset::detect($head, RCUBE_CHARSET);
        $csv      = rcube_charset::convert($csv, $charset);
        $head     = '';
@@ -312,7 +311,7 @@
        $this->map = array();
        // Parse file
        foreach (preg_split("/[\r\n]+/", $csv) as $i => $line) {
        foreach (preg_split("/[\r\n]+/", $csv) as $line) {
            $elements = $this->parse_line($line);
            if (empty($elements)) {
                continue;
@@ -389,6 +388,12 @@
        if (!empty($this->local_label_map)) {
            for ($i = 0; $i < $size; $i++) {
                $label = $this->local_label_map[$elements[$i]];
                // special localization label
                if ($label && $label[0] == '_') {
                    $label = substr($label, 1);
                }
                if ($label && !empty($this->csv2vcard_map[$label])) {
                    $map2[$i] = $this->csv2vcard_map[$label];
                }