added path value support on the file check on Special:Version.
authorShinjiman <shinjiman@users.mediawiki.org>
Wed, 1 Jul 2009 21:31:44 +0000 (21:31 +0000)
committerShinjiman <shinjiman@users.mediawiki.org>
Wed, 1 Jul 2009 21:31:44 +0000 (21:31 +0000)
link to r52646 and r52624 for Code Review comments.

includes/specials/SpecialVersion.php

index a843650..0701a8c 100644 (file)
@@ -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] );