From 68da25153d5ec72577c730744de8bc492b6a0b38 Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Sun, 28 Jun 2009 17:24:48 +0000 Subject: [PATCH] fix regression in r52516 for some distributions which are unable to show the version information. --- includes/specials/SpecialVersion.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 6c73b124e2..d92bc0f249 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -156,31 +156,33 @@ class SpecialVersion extends SpecialPage { $swSVGConvName = $wgSVGConverter; $haveSVGConvVer = false; $pathVar = '$path/'; + $binPath = '/usr/bin/'; $execPath = strtok(strstr($wgSVGConverters[$wgSVGConverter],$pathVar), ' '); $execPath = substr_replace($execPath, '', 0, strlen($pathVar)); $execFullPath = trim($wgSVGConverterPath,'"') . $execPath; + $execBinPath = $binPath . $execPath; if (strstr($execFullPath, ' ') != false) { - $execFullPath = '"'.$execFullPath.'"'; + $execFullPath = '"' . $execFullPath . '"'; } if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) { // Get version info for ImageMagick - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) + if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) $swSVGConvInfo = self::execOutput( $execFullPath . ' -version' ); list( $head, $tail ) = explode( 'ImageMagick', $swSVGConvInfo ); list( $swSVGConvVer ) = explode('http://www.imagemagick.org', $tail ); $swSVGConvURL = 'http://www.imagemagick.org/'; $haveSVGConvVer = true; - } else if (strstr ($execFullPath, 'rsvg') != false) { + } else if ( strstr ($execFullPath, 'rsvg') != false ) { // Get version info for rsvg - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) + if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) $swSVGConvInfo = self::execOutput( $execFullPath . ' -v' ); $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); $swSVGConvVer = $swSVGConvLine[0]; $swSVGConvURL = 'http://librsvg.sourceforge.net/'; $haveSVGConvVer = true; - } else if (strstr ($execFullPath, 'inkscape') != false) { + } else if ( strstr ($execFullPath, 'inkscape') != false ) { // Get version info for Inkscape - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) + if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) $swSVGConvInfo = self::execOutput( $execFullPath . ' -z -V' ); $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); $swSVGConvVer = ltrim( $swSVGConvLine[0], 'Inkscape ' ); -- 2.20.1