summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/graphics.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-01-10 15:49:15 -0800
committerBharat Mediratta <bharat@menalto.com>2011-01-10 15:49:15 -0800
commit23eaec7063b81d4dae04ec3f5c311a0a2f228a05 (patch)
tree136b478c0f47ceb7947b17b7a52fde80c50cc338 /modules/gallery/helpers/graphics.php
parentd557b2a63e2ea424965fb53be9f6b76ad3f18015 (diff)
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.
Diffstat (limited to 'modules/gallery/helpers/graphics.php')
-rw-r--r--modules/gallery/helpers/graphics.php8
1 files changed, 2 insertions, 6 deletions
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 <b>exec</b> 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) &&