Populate $extensionPath if isset( $extension['path'] )
authorBryan Davis <bd808@wikimedia.org>
Tue, 15 Jul 2014 21:47:32 +0000 (15:47 -0600)
committerBryan Davis <bd808@wikimedia.org>
Tue, 15 Jul 2014 21:50:43 +0000 (15:50 -0600)
$extensionPath is initialized to null and then only set when no cached
vcs information was found. Instead set it to the proper value as soon as
we know that $extension['path'] exists. This will fix display of license
file links for most extensions.

Change-Id: I93bfedf3ae0cb7e6f9e077aa1d83906f7a3283b2

includes/specials/SpecialVersion.php

index a857da4..28ad0f4 100644 (file)
@@ -650,6 +650,7 @@ class SpecialVersion extends SpecialPage {
 
                if ( isset( $extension['path'] ) ) {
                        global $IP;
+                       $extensionPath = dirname( $extension['path'] );
                        if ( $this->coreId == '' ) {
                                wfDebug( 'Looking up core head id' );
                                $coreHeadSHA1 = self::getGitHeadSha1( $IP );
@@ -668,7 +669,6 @@ class SpecialVersion extends SpecialPage {
 
                        if ( !$vcsVersion ) {
                                wfDebug( "Getting VCS info for extension $extensionName" );
-                               $extensionPath = dirname( $extension['path'] );
                                $gitInfo = new GitInfo( $extensionPath );
                                $vcsVersion = $gitInfo->getHeadSHA1();
                                if ( $vcsVersion !== false ) {