Revert r23471, r23474: restore Special:Version to working, non-ugly state
[lhc/web/wiklou.git] / includes / SpecialVersion.php
index 36da5ca..0b63393 100644 (file)
@@ -2,10 +2,7 @@
 /**#@+
  * Give information about the version of MediaWiki, PHP, the DB and extensions
  *
- * @package MediaWiki
- * @subpackage SpecialPage
- *
- * @bug 2019, 4531
+ * @addtogroup SpecialPage
  *
  * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
  * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
@@ -50,10 +47,7 @@ class SpecialVersion {
         */
        function MediaWikiCredits() {
                $version = self::getVersion();
-               $dbr =& wfGetDB( DB_SLAVE );
-
-               global $wgLanguageNames, $wgLanguageCode;
-               $mwlang = $wgLanguageNames[$wgLanguageCode];
+               $dbr = wfGetDB( DB_SLAVE );
 
                $ret =
                "__NOTOC__
@@ -118,9 +112,9 @@ class SpecialVersion {
                                foreach ( $wgExtensionCredits[$type] as $extension ) {
                                        $out .= $this->formatCredits(
                                                isset ( $extension['name'] )        ? $extension['name']        : '',
-                                               isset ( $extension['version'] )     ? $extension['version']     : '',
+                                               isset ( $extension['version'] )     ? $extension['version']     : null,
                                                isset ( $extension['author'] )      ? $extension['author']      : '',
-                                               isset ( $extension['url'] )         ? $extension['url']         : '',
+                                               isset ( $extension['url'] )         ? $extension['url']         : null,
                                                isset ( $extension['description'] ) ? $extension['description'] : ''
                                        );
                                }
@@ -193,7 +187,7 @@ class SpecialVersion {
 
                        foreach ($myWgHooks as $hook => $hooks)
                                $ret .= "<tr><td>$hook</td><td>" . $this->listToText( $hooks ) . "</td></tr>\n";
-                       
+
                        $ret .= '</table>';
                        return $ret;
                } else
@@ -256,7 +250,10 @@ class SpecialVersion {
         * @return mixed
         */
        function arrayToString( $list ) {
-               if ( ! is_array( $list ) ) {
+               if( is_object( $list ) ) {
+                       $class = get_class( $list );
+                       return "($class)";
+               } elseif ( ! is_array( $list ) ) {
                        return $list;
                } else {
                        $class = get_class( $list[0] );
@@ -267,8 +264,6 @@ class SpecialVersion {
        /**
         * Retrieve the revision number of a Subversion working directory.
         *
-        * @bug 7335
-        *
         * @param string $dir
         * @return mixed revision number as int, or false if not a SVN checkout
         */
@@ -290,7 +285,10 @@ class SpecialVersion {
                                return false;
                        }
 
-                       $xml = simplexml_load_file( $entries, "SimpleXMLElement", LIBXML_NOWARNING );
+                       // SimpleXml whines about the xmlns...
+                       wfSuppressWarnings();
+                       $xml = simplexml_load_file( $entries );
+                       wfRestoreWarnings();
 
                        if( $xml ) {
                                foreach( $xml->entry as $entry ) {