From fcb7d4fc034335d960917abd37254bd3997cf2f3 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 1 Aug 2014 12:49:37 +0200 Subject: Fix various iCloud vCard issues, added fallback for external photos (#1489993) --- program/steps/addressbook/photo.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'program/steps/addressbook/photo.inc') diff --git a/program/steps/addressbook/photo.inc b/program/steps/addressbook/photo.inc index 482185735..30d09ffcc 100644 --- a/program/steps/addressbook/photo.inc +++ b/program/steps/addressbook/photo.inc @@ -72,8 +72,12 @@ $plugin = $RCMAIL->plugins->exec_hook('contact_photo', if ($plugin['url']) { $RCMAIL->output->redirect($plugin['url']); } -else { - $data = $plugin['data']; + +$data = $plugin['data']; + +// detect if photo data is an URL +if (strlen($data) < 1024 && filter_var($data, FILTER_VALIDATE_URL)) { + $RCMAIL->output->redirect($data); } // deliver alt image -- cgit v1.2.3