From fcb7d4fc034335d960917abd37254bd3997cf2f3 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 01 Aug 2014 06:49:37 -0400
Subject: [PATCH] Fix various iCloud vCard issues, added fallback for external photos (#1489993)

---
 program/steps/addressbook/func.inc |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index d4c57cc..38de93d 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -816,11 +816,15 @@
         }
         $photo_img = $RCMAIL->url($url);
     }
-    else
+    else {
         $ff_value = '-del-'; // will disable delete-photo action
+    }
 
-    $img = html::img(array('src' => $photo_img, 'border' => 1, 'alt' => $RCMAIL->gettext('contactphoto')));
-    $content = html::div($attrib, $img);
+    $content = html::div($attrib, html::img(array(
+            'src'     => $photo_img,
+            'alt'     => $RCMAIL->gettext('contactphoto'),
+            'onerror' => 'this.src = rcmail.env.photo_placeholder',
+    )));
 
     if ($CONTACT_COLTYPES['photo'] && ($RCMAIL->action == 'edit' || $RCMAIL->action == 'add')) {
         $RCMAIL->output->add_gui_object('contactphoto', $attrib['id']);

--
Gitblit v1.9.1