aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_attachments.php9
-rw-r--r--phpBB/includes/functions.php3
2 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 3871f921b6..fa83da20b1 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1123,9 +1123,18 @@ class acp_attachments
if (empty($_ENV['MAGICK_HOME']))
{
$locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/');
+ $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', $_ENV['PATH'])));
+
+ $locations = array_merge($path_locations, $locations);
foreach ($locations as $location)
{
+ // The path might not end properly, fudge it
+ if (substr($location, -1, 1) !== '/')
+ {
+ $location .= '/';
+ }
+
if (@is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
{
$imagick = str_replace('\\', '/', $location);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 1949b5f6c4..d474505eff 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -161,7 +161,8 @@ if (!function_exists('array_combine'))
$values = array_values($values);
$n = sizeof($keys);
- if (!$n || !sizeof($values) || ($n != sizeof($values)))
+ $m = sizeof($values);
+ if (!$n || !$m || ($n != $m))
{
return false;
}