From 23eaec7063b81d4dae04ec3f5c311a0a2f228a05 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 10 Jan 2011 15:49:15 -0800 Subject: Stop using "which" to find binaries. Create system::find_binary() which traverses the $PATH and returns any executable binary of the appropriate name that it can find. Fixes #1555. --- modules/gallery/helpers/graphics.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'modules/gallery/helpers/graphics.php') diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 29527705..18820ed7 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -313,11 +313,6 @@ class graphics_Core { $toolkits->graphicsmagick->installed = false; $toolkits->graphicsmagick->error = t("GraphicsMagick requires the exec function"); } else { - gallery::set_path_env( - array(module::get_var("gallery", "graphics_toolkit_path"), - getenv("PATH"), - module::get_var("gallery", "extra_binary_paths"))); - // ImageMagick & GraphicsMagick $magick_kits = array( "imagemagick" => array( @@ -328,7 +323,8 @@ class graphics_Core { "version_regex" => "/\S+ (\S+)/")); // Loop through the kits foreach ($magick_kits as $index => $settings) { - $path = exec("which " . $settings["binary"]); + $path = system::find_binary( + $settings["binary"], module::get_var("gallery", "graphics_toolkit_path")); $toolkits->$index->name = $settings["name"]; if ($path) { if (@is_file($path) && -- cgit v1.2.3