From 88910811a8800ff632df4cbe4a94e7231616b8f9 Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Sun, 28 Jun 2009 17:29:31 +0000 Subject: [PATCH] further fix up for r52522, link to r52516 for CodeReview if having any comments. --- includes/specials/SpecialVersion.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index d92bc0f249..18ed0ca289 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -166,7 +166,9 @@ class SpecialVersion extends SpecialPage { } if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) { // Get version info for ImageMagick - if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) + if ( file_exists( $execBinPath ) ) + $swSVGConvInfo = self::execOutput( $execBinPath . ' -version' ); + else if ( 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 ); @@ -174,7 +176,9 @@ class SpecialVersion extends SpecialPage { $haveSVGConvVer = true; } else if ( strstr ($execFullPath, 'rsvg') != false ) { // Get version info for rsvg - if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) + if ( file_exists( $execBinPath ) ) + $swSVGConvInfo = self::execOutput( $execBinPath . ' -v' ); + else if ( file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) $swSVGConvInfo = self::execOutput( $execFullPath . ' -v' ); $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); $swSVGConvVer = $swSVGConvLine[0]; @@ -182,7 +186,9 @@ class SpecialVersion extends SpecialPage { $haveSVGConvVer = true; } else if ( strstr ($execFullPath, 'inkscape') != false ) { // Get version info for Inkscape - if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) + if ( file_exists( $execBinPath ) ) + $swSVGConvInfo = self::execOutput( $execBinPath . ' -z -V' ); + else if ( 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