r52522 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52521‎ | r52522 | r52523 >
Date:17:24, 28 June 2009
Author:shinjiman
Status:reverted
Tags:
Comment:
fix regression in r52516 for some distributions which are unable to show the version information.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -156,31 +156,33 @@
157157 $swSVGConvName = $wgSVGConverter;
158158 $haveSVGConvVer = false;
159159 $pathVar = '$path/';
 160+ $binPath = '/usr/bin/';
160161 $execPath = strtok(strstr($wgSVGConverters[$wgSVGConverter],$pathVar), ' ');
161162 $execPath = substr_replace($execPath, '', 0, strlen($pathVar));
162163 $execFullPath = trim($wgSVGConverterPath,'"') . $execPath;
 164+ $execBinPath = $binPath . $execPath;
163165 if (strstr($execFullPath, ' ') != false) {
164 - $execFullPath = '"'.$execFullPath.'"';
 166+ $execFullPath = '"' . $execFullPath . '"';
165167 }
166168 if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) {
167169 // Get version info for ImageMagick
168 - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) )
 170+ if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
169171 $swSVGConvInfo = self::execOutput( $execFullPath . ' -version' );
170172 list( $head, $tail ) = explode( 'ImageMagick', $swSVGConvInfo );
171173 list( $swSVGConvVer ) = explode('http://www.imagemagick.org', $tail );
172174 $swSVGConvURL = 'http://www.imagemagick.org/';
173175 $haveSVGConvVer = true;
174 - } else if (strstr ($execFullPath, 'rsvg') != false) {
 176+ } else if ( strstr ($execFullPath, 'rsvg') != false ) {
175177 // Get version info for rsvg
176 - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) )
 178+ if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
177179 $swSVGConvInfo = self::execOutput( $execFullPath . ' -v' );
178180 $swSVGConvLine = explode("\n",$swSVGConvInfo ,2);
179181 $swSVGConvVer = $swSVGConvLine[0];
180182 $swSVGConvURL = 'http://librsvg.sourceforge.net/';
181183 $haveSVGConvVer = true;
182 - } else if (strstr ($execFullPath, 'inkscape') != false) {
 184+ } else if ( strstr ($execFullPath, 'inkscape') != false ) {
183185 // Get version info for Inkscape
184 - if ( file_exists( trim( $execFullPath, '"' ) ) || file_exists( trim( $execFullPath, '"' ) . '.exe' ) )
 186+ if ( ( file_exists( $execBinPath ) ) || file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
185187 $swSVGConvInfo = self::execOutput( $execFullPath . ' -z -V' );
186188 $swSVGConvLine = explode("\n",$swSVGConvInfo ,2);
187189 $swSVGConvVer = ltrim( $swSVGConvLine[0], 'Inkscape ' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r52523further fix up for r52522, link to r52516 for CodeReview if having any comments.shinjiman17:29, 28 June 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52516* (bug 14611) Added support showing the version of the SVG image thumbnailing...shinjiman16:25, 28 June 2009

Status & tagging log