Revision: 52522
Author:   shinjiman
Date:     2009-06-28 17:24:48 +0000 (Sun, 28 Jun 2009)

Log Message:
-----------
fix regression in r52516 for some distributions which are unable to show the 
version information.

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialVersion.php

Modified: trunk/phase3/includes/specials/SpecialVersion.php
===================================================================
--- trunk/phase3/includes/specials/SpecialVersion.php   2009-06-28 17:18:53 UTC 
(rev 52521)
+++ trunk/phase3/includes/specials/SpecialVersion.php   2009-06-28 17:24:48 UTC 
(rev 52522)
@@ -156,31 +156,33 @@
                        $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 ' );



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to