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_addressbook.php |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php
index eb8bd3d..5f13da0 100644
--- a/program/lib/Roundcube/rcube_addressbook.php
+++ b/program/lib/Roundcube/rcube_addressbook.php
@@ -539,7 +539,7 @@
         else if ($compose_mode == 1)
             $fn = join(' ', array($contact['firstname'], $contact['middlename'], $contact['surname']));
         else if ($compose_mode == 0)
-            $fn = !empty($contact['name']) ? $contact['name'] : join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix']));
+            $fn = $contact['name'] ?: join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix']));
         else {
             $plugin = rcube::get_instance()->plugins->exec_hook('contact_listname', array('contact' => $contact));
             $fn     = $plugin['fn'];
@@ -550,12 +550,12 @@
         // fallbacks...
         if ($fn === '') {
             // ... display name
-            if (!empty($contact['name'])) {
-                $fn = $contact['name'];
+            if ($name = trim($contact['name'])) {
+                $fn = $name;
             }
             // ... organization
-            else if (!empty($contact['organization'])) {
-                $fn = $contact['organization'];
+            else if ($org = trim($contact['organization'])) {
+                $fn = $org;
             }
             // ... email address
             else if (($email = self::get_col_values('email', $contact, true)) && !empty($email)) {

--
Gitblit v1.9.1