From 39bf11f1b24d6a2a1eb539e126d2a891b56d7423 Mon Sep 17 00:00:00 2001
From: Jochen Roth <jochen.roth@b13.com>
Date: Wed, 23 Aug 2023 20:16:25 +0200
Subject: [PATCH] [BUGFIX] Continue loop in case binary was not found

The change introduced with #101444 broke
the binary finder mechanims.

This has been fixed by "continue" the loop
instead of "break" the loop. So all paths are
tested instead of just the first one.

Resolves: #101687
Related: #101444
Releases: main, 12.4
Change-Id: Iddf55f2e936f79038c2f52a93040ac48c8a9a1dd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80677
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Classes/Configuration/Image/GraphicsMagickPreset.php        | 2 +-
 .../install/Classes/Configuration/Image/ImageMagick6Preset.php  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/install/Classes/Configuration/Image/GraphicsMagickPreset.php b/typo3/sysext/install/Classes/Configuration/Image/GraphicsMagickPreset.php
index f7b5cb16686b..fa3f7fa5c6df 100644
--- a/typo3/sysext/install/Classes/Configuration/Image/GraphicsMagickPreset.php
+++ b/typo3/sysext/install/Classes/Configuration/Image/GraphicsMagickPreset.php
@@ -75,7 +75,7 @@ class GraphicsMagickPreset extends AbstractImagePreset
 
             $binaryPath = $path . $executable;
             if (!file_exists($binaryPath) || !is_executable($binaryPath)) {
-                break;
+                continue;
             }
 
             $command = escapeshellarg($binaryPath) . ' -version';
diff --git a/typo3/sysext/install/Classes/Configuration/Image/ImageMagick6Preset.php b/typo3/sysext/install/Classes/Configuration/Image/ImageMagick6Preset.php
index 0569c05accb3..9ea9b4111b77 100644
--- a/typo3/sysext/install/Classes/Configuration/Image/ImageMagick6Preset.php
+++ b/typo3/sysext/install/Classes/Configuration/Image/ImageMagick6Preset.php
@@ -79,7 +79,7 @@ class ImageMagick6Preset extends AbstractImagePreset
 
             $binaryPath = $path . $executable;
             if (!file_exists($binaryPath) || !is_executable($binaryPath)) {
-                break;
+                continue;
             }
 
             $command = escapeshellarg($binaryPath) . ' -version';
-- 
GitLab