From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 05 Feb 2016 07:25:27 -0500 Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports --- program/lib/Roundcube/rcube_vcard.php | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index 798bbab..cea61bd 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -124,11 +124,6 @@ $this->raw = self::charset_convert($this->raw, $detected_charset); } - // consider FN empty if the same as the primary e-mail address - if ($this->raw['FN'][0][0] == $this->raw['EMAIL'][0][0]) { - $this->raw['FN'][0][0] = ''; - } - // find well-known address fields $this->displayname = $this->raw['FN'][0][0]; $this->surname = $this->raw['N'][0][0]; @@ -201,7 +196,7 @@ } while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) { - $subtype = $typemap[$raw['type'][++$k]] ? $typemap[$raw['type'][$k]] : strtolower($raw['type'][$k]); + $subtype = $typemap[$raw['type'][++$k]] ?: strtolower($raw['type'][$k]); } } @@ -212,7 +207,7 @@ && !in_array($k, array('pref','internet','voice','base64')) ) { $k_uc = strtoupper($k); - $subtype = $typemap[$k_uc] ? $typemap[$k_uc] : $k; + $subtype = $typemap[$k_uc] ?: $k; break; } } @@ -390,7 +385,7 @@ $this->raw[$tag][$index] = (array)$value; if ($type) { $typemap = array_flip($this->typemap); - $this->raw[$tag][$index]['type'] = explode(',', ($typemap[$type_uc] ? $typemap[$type_uc] : $type)); + $this->raw[$tag][$index]['type'] = explode(',', $typemap[$type_uc] ?: $type); } } else { @@ -663,7 +658,7 @@ // $entry['base64'] = true; } - $data = self::decode_value($data, $enc ? $enc : 'base64'); + $data = self::decode_value($data, $enc ?: 'base64'); } else if ($field == 'PHOTO') { // vCard 4.0 data URI, "PHOTO:data:image/jpeg;base64,..." -- Gitblit v1.9.1