From 1776786aae64ee74d18cdee18ae9568b3ed8c515 Mon Sep 17 00:00:00 2001 From: Shinjiman Date: Wed, 1 Jul 2009 21:31:44 +0000 Subject: [PATCH] added path value support on the file check on Special:Version. link to r52646 and r52624 for Code Review comments. --- includes/specials/SpecialVersion.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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] ); -- 2.20.1