fix regression in r52516 for some distributions which are unable to show the version...
authorShinjiman <shinjiman@users.mediawiki.org>
Sun, 28 Jun 2009 17:24:48 +0000 (17:24 +0000)
committerShinjiman <shinjiman@users.mediawiki.org>
Sun, 28 Jun 2009 17:24:48 +0000 (17:24 +0000)
includes/specials/SpecialVersion.php

index 6c73b12..d92bc0f 100644 (file)
@@ -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 ' );