From: Shinjiman Date: Wed, 1 Jul 2009 21:31:44 +0000 (+0000) Subject: added path value support on the file check on Special:Version. X-Git-Tag: 1.31.0-rc.0~41145 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=1776786aae64ee74d18cdee18ae9568b3ed8c515;p=lhc%2Fweb%2Fwiklou.git added path value support on the file check on Special:Version. link to r52646 and r52624 for Code Review comments. --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index a8436503b3..0701a8c1bb 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -240,6 +240,15 @@ class SpecialVersion extends SpecialPage { $swWhereIsBinPath = explode( ' ', $swWhereIsFirstLine, 3); if ( count( $swWhereIsBinPath ) > 1 ) $wBinPath = dirname( $swWhereIsBinPath[1] ); + } else { + $swPathLine = explode( ';', $_SERVER[PATH] ); + $swPathFound = false; + foreach( $swPathLine as $swPathDir ) { + if ( file_exists( $swPathDir . '/' . $swMathCmd . '.exe' ) && ($swPathFound === false) ) { + $wBinPath = $swPathDir . '/'; + $swPathFound = true; + } + } } if ( file_exists( $binPath . $swMathCmd ) || file_exists( $wBinPath . $swMathCmd ) ) { $swMathInfo = self::execOutput( $swMathCmd . ' ' . $swMathParam[$swMath] );