Special:Version: Treat AUTHORS.txt and CREDITS.txt as text, not wikitext
authorBrad Jorsch <bjorsch@wikimedia.org>
Mon, 3 Mar 2014 17:53:55 +0000 (12:53 -0500)
committerAnomie <bjorsch@wikimedia.org>
Mon, 3 Mar 2014 18:01:34 +0000 (18:01 +0000)
A review of existing extensions in git reveals that 3 of the 5
extensions that have a non-wikitext authors/credits file have this file
named AUTHORS.txt, while none of the 8 that have wikitext
authors/credits have a .txt extension. So let's fix the 2 that have
non-wikitext as "AUTHORS" and do this for the benefit of the other three
that presumably don't want to use wikitext in authors/credits.

Bug: 62153
Change-Id: Id95852ab9836fb284becd7e251374f672b69515f

includes/specials/SpecialVersion.php

index c38b009..870fa11 100644 (file)
@@ -86,6 +86,9 @@ class SpecialVersion extends SpecialPage {
                                        $file = $this->getExtAuthorsFileName( dirname( $extNode['path'] ) );
                                        if ( $file ) {
                                                $wikiText = file_get_contents( $file );
+                                               if ( substr( $file, -4 ) === '.txt' ) {
+                                                       $wikiText = Html::element( 'pre', array(), $wikiText );
+                                               }
                                        }
                                }