From a1879c2a2149a24e3f26b3d2d77c42d7f457a1a9 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Thu, 4 Aug 2016 23:07:06 +0200 Subject: [PATCH] diagnostics: don't assume that gd_info exists (fixes #565). --- plugins/Diagnostics/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/Diagnostics/index.php b/plugins/Diagnostics/index.php index c7cf963..ff4cd4d 100644 --- a/plugins/Diagnostics/index.php +++ b/plugins/Diagnostics/index.php @@ -53,10 +53,13 @@ if (hasPermissions(LYCHEE_UPLOADS)===false) $error .= ('Error: \'uploads/ if (hasPermissions(LYCHEE_DATA)===false) $error .= ('Error: \'data/\' is missing or has insufficient read/write privileges' . PHP_EOL); // About GD -$gdVersion = gd_info(); -if (!$gdVersion['JPEG Support']) $error .= ('Error: PHP gd extension without jpeg support' . PHP_EOL); -if (!$gdVersion['PNG Support']) $error .= ('Error: PHP gd extension without png support' . PHP_EOL); -if (!$gdVersion['GIF Read Support'] || !$gdVersion['GIF Create Support']) $error .= ('Error: PHP gd extension without full gif support' . PHP_EOL); +$gdVersion = array('GD Version' => '-'); +if (function_exists('gd_info')) { + $gdVersion = gd_info(); + if (!$gdVersion['JPEG Support']) $error .= ('Error: PHP gd extension without jpeg support' . PHP_EOL); + if (!$gdVersion['PNG Support']) $error .= ('Error: PHP gd extension without png support' . PHP_EOL); + if (!$gdVersion['GIF Read Support'] || !$gdVersion['GIF Create Support']) $error .= ('Error: PHP gd extension without full gif support' . PHP_EOL); +} // Load config if (!file_exists(LYCHEE_CONFIG_FILE)) exit('Error: Configuration not found. Please install Lychee for additional tests');