From 9133a49894a77c2c975a8c87bc608616e68efe63 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 5 Sep 2017 08:33:40 +0200 Subject: [PATCH] Fix bug where pink image was used instead of a thumbnail when image resize fails (#5933) Note GD and Imagick in INSTALL file and optional installer checks. --- CHANGELOG | 2 ++ INSTALL | 1 + installer/check.php | 4 ++++ program/steps/mail/get.inc | 3 --- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9587fbffe..d1935cc09 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG Roundcube Webmail =========================== +- Fix bug where pink image was used instead of a thumbnail when image resize fails (#5933) + RELEASE 1.3.1 ------------- - Don't ignore (global) userlogins/sendmail logs in per_user_logging mode diff --git a/INSTALL b/INSTALL index e7ff603d3..fea856ebb 100644 --- a/INSTALL +++ b/INSTALL @@ -16,6 +16,7 @@ REQUIREMENTS - PHP PDO with driver for either MySQL, PostgreSQL, SQL Server, Oracle or SQLite (required) - Iconv, Zip, Fileinfo, Intl, Exif (recommended) - LDAP for LDAP addressbook support (optional) + - GD, Imagick (optional thumbnails generation, QR-code) * PEAR and PEAR packages distributed with Roundcube or external: - Mail_Mime 1.10.0 or newer - Net_SMTP 1.7.1 or newer diff --git a/installer/check.php b/installer/check.php index 8dfa3b37a..3fdeb1cdd 100644 --- a/installer/check.php +++ b/installer/check.php @@ -25,6 +25,8 @@ $optional_php_exts = array( 'Intl' => 'intl', 'Exif' => 'exif', 'LDAP' => 'ldap', + 'GD' => 'gd', + 'Imagick' => 'imagick', ); $required_libs = array( @@ -67,6 +69,8 @@ $source_urls = array( 'oci8' => 'http://www.php.net/manual/en/book.oci8.php', 'PDO' => 'http://www.php.net/manual/en/book.pdo.php', 'LDAP' => 'http://www.php.net/manual/en/book.ldap.php', + 'GD' => 'http://www.php.net/manual/en/book.image.php', + 'Imagick' => 'http://www.php.net/manual/en/book.imagick.php', 'pdo_mysql' => 'http://www.php.net/manual/en/ref.pdo-mysql.php', 'pdo_pgsql' => 'http://www.php.net/manual/en/ref.pdo-pgsql.php', 'pdo_sqlite' => 'http://www.php.net/manual/en/ref.pdo-sqlite.php', diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index 47977def0..fbfda5008 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -94,8 +94,6 @@ if (!empty($_GET['_thumb']) && $attachment->is_valid()) { $_GET['_thumb'] = 0; $_REQUEST['_embed'] = 1; } - - unlink($orig_name); } if (!empty($_GET['_thumb'])) { @@ -293,7 +291,6 @@ if (empty($_GET['_thumb']) && $attachment->is_valid()) { header("Content-Length: " . filesize($file_path)); readfile($file_path); } - unlink($file_path); } } else {