X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialVersion.php;h=80560bed54ab9fd5fc4460eb2d77ddf1c201e13c;hb=925345541f17c273b77fdc218221449df649582a;hp=f6fa5ea36fbce5f36b4532d7f9c76567401202b3;hpb=b73b2456896c949cfe319ff310521679566ecbcf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index f6fa5ea36f..80560bed54 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -92,7 +92,14 @@ class SpecialVersion extends SpecialPage { if ( $file ) { $wikiText = file_get_contents( $file ); if ( substr( $file, -4 ) === '.txt' ) { - $wikiText = Html::element( 'pre', array(), $wikiText ); + $wikiText = Html::element( + 'pre', + array( + 'lang' => 'en', + 'dir' => 'ltr', + ), + $wikiText + ); } } } @@ -109,7 +116,14 @@ class SpecialVersion extends SpecialPage { $file = $this->getExtLicenseFileName( dirname( $extNode['path'] ) ); if ( $file ) { $wikiText = file_get_contents( $file ); - $wikiText = "
$wikiText
"; + $wikiText = Html::element( + 'pre', + array( + 'lang' => 'en', + 'dir' => 'ltr', + ), + $wikiText + ); } } @@ -504,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' ), @@ -531,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 @@ -1052,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 ) ) { @@ -1124,7 +1134,10 @@ class SpecialVersion extends SpecialPage { if ( is_array( $list ) && count( $list ) == 1 ) { $list = $list[0]; } - if ( is_object( $list ) ) { + if ( $list instanceof Closure ) { + // Don't output stuff like "Closure$;1028376090#8$48499d94fe0147f7c633b365be39952b$" + return 'Closure'; + } elseif ( is_object( $list ) ) { $class = wfMessage( 'parentheses' )->params( get_class( $list ) )->escaped(); return $class;