Aleksander Machniak
2015-06-07 a9587489473baf3854999e711083be212ca0c1c4
program/steps/addressbook/photo.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/addressbook/photo.inc                                   |
 |                                                                       |
@@ -72,13 +72,12 @@
if ($plugin['url']) {
    $RCMAIL->output->redirect($plugin['url']);
}
else {
    $data = $plugin['data'];
}
// deliver alt image
if (!$data && ($alt_img = rcube_utils::get_input_value('_alt', rcube_utils::INPUT_GPC)) && is_file($alt_img)) {
    $data = file_get_contents($alt_img);
$data = $plugin['data'];
// detect if photo data is an URL
if (strlen($data) < 1024 && filter_var($data, FILTER_VALIDATE_URL)) {
    $RCMAIL->output->redirect($data);
}
// cache for one day if requested by email
@@ -86,6 +85,12 @@
    $RCMAIL->output->future_expire_header(86400);
}
header('Content-Type: ' . rcube_mime::image_content_type($data));
echo $data ? $data : file_get_contents('program/resources/blank.gif');
if ($data) {
    header('Content-Type: ' . rcube_mime::image_content_type($data));
    echo $data;
}
else {
    header('Content-Type: image/gif');
    echo base64_decode(rcmail_output::BLANK_GIF);
}
exit;