diff --git a/CHANGELOG.md b/CHANGELOG.md index 4380dc8..7b9c7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v2.1.2 +## 10/22/2024 + +1. [](#improved) + * Improved `gd` module check [#36](https://github.com/getgrav/grav-plugin-problems/pull/36) + # v2.1.1 ## 04/14/2021 diff --git a/blueprints.yaml b/blueprints.yaml index 1456dfb..09aa5b5 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Problems slug: problems type: plugin -version: 2.1.1 +version: 2.1.2 description: Detects and reports problems found in the site. icon: exclamation-circle author: diff --git a/classes/Problems/PHPModules.php b/classes/Problems/PHPModules.php index 643d550..6abdc52 100644 --- a/classes/Problems/PHPModules.php +++ b/classes/Problems/PHPModules.php @@ -57,19 +57,21 @@ public function process() $msg = 'PHP GD (Image Manipulation Library) is %s installed'; if (defined('GD_VERSION') && function_exists('gd_info')) { - $msg = $modules_success['gd'] = sprintf($msg, 'successfully'); + $msg = sprintf($msg, 'successfully'); // Extra checks for Image support $ginfo = gd_info(); - $gda = array('PNG Support', 'JPEG Support', 'FreeType Support', 'GIF Read Support'); + $gda = array('PNG Support', 'JPEG Support', 'FreeType Support', 'GIF Read Support', 'WebP Support', 'AVIF Support'); $gda_msg = ''; $problems_found = false; foreach ($gda as $image_type) { - if (!$ginfo[$image_type]) { + if (!array_key_exists($image_type, $ginfo)) { $problems_found = true; - $gda_msg = "missing $image_type, but is "; - break; + if($gda_msg !== '') { + $gda_msg .= ', '; + } + $gda_msg .= $image_type; } }