Merge "mw.Upload.BookletLayout: Don't explode when the API call fails with 'exception'"
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 38baf5b..43228fa 100644 (file)
@@ -518,16 +518,12 @@ class SpecialVersion extends SpecialPage {
         */
        protected function getExternalLibraries() {
                global $IP;
-               $path = "$IP/composer.lock";
+               $path = "$IP/vendor/composer/installed.json";
                if ( !file_exists( $path ) ) {
-                       // Maybe they're using mediawiki/vendor?
-                       $path = "$IP/vendor/composer.lock";
-                       if ( !file_exists( $path ) ) {
-                               return '';
-                       }
+                       return '';
                }
 
-               $lock = new ComposerLock( $path );
+               $installed = new ComposerInstalled( $path );
                $out = Html::element(
                        'h2',
                        array( 'id' => 'mw-version-libraries' ),
@@ -545,7 +541,7 @@ class SpecialVersion extends SpecialPage {
                        . Html::element( 'th', array(), $this->msg( 'version-libraries-authors' )->text() )
                        . Html::closeElement( 'tr' );
 
-               foreach ( $lock->getInstalledDependencies() as $name => $info ) {
+               foreach ( $installed->getInstalledDependencies() as $name => $info ) {
                        if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
                                // Skip any extensions or skins since they'll be listed
                                // in their proper section
@@ -711,7 +707,7 @@ class SpecialVersion extends SpecialPage {
         *  - The name of (name), and URL link to (url), the extension
         *  - Official version number (version) and if available version control system
         *    revision (path), link, and date
-        *  - If available the short name of the license (license-name) and a linke
+        *  - If available the short name of the license (license-name) and a link
         *    to ((LICENSE)|(COPYING))(\.txt)? if it exists.
         *  - Description of extension (descriptionmsg or description)
         *  - List of authors (author) and link to a ((AUTHORS)|(CREDITS))(\.txt)? file if it exists
@@ -844,7 +840,7 @@ class SpecialVersion extends SpecialPage {
                        if ( isset( $extension['license-name'] ) ) {
                                $licenseName = $out->parseInline( $extension['license-name'] );
                        } elseif ( $this->getExtLicenseFileName( $extensionPath ) ) {
-                               $licenseName = $this->msg( 'version-ext-license' );
+                               $licenseName = $this->msg( 'version-ext-license' )->escaped();
                        }
                        if ( $licenseName !== null ) {
                                $licenseLink = Linker::link(
@@ -1066,7 +1062,7 @@ class SpecialVersion extends SpecialPage {
 
                foreach ( scandir( $extDir ) as $file ) {
                        $fullPath = $extDir . DIRECTORY_SEPARATOR . $file;
-                       if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt)?$/', $file ) &&
+                       if ( preg_match( '/^((AUTHORS)|(CREDITS))(\.txt|\.wiki|\.mediawiki)?$/', $file ) &&
                                is_readable( $fullPath ) &&
                                is_file( $fullPath )
                        ) {