/**#@+
* Give information about the version of MediaWiki, PHP, the DB and extensions
*
- * @package MediaWiki
- * @subpackage SpecialPage
+ * @addtogroup SpecialPage
*
* @bug 2019, 4531
*
*/
function MediaWikiCredits() {
$version = self::getVersion();
- $dbr =& wfGetDB( DB_SLAVE );
-
- global $wgLanguageNames, $wgLanguageCode;
- $mwlang = $wgLanguageNames[$wgLanguageCode];
+ $dbr = wfGetDB( DB_SLAVE );
$ret =
"__NOTOC__
$out .= wfOpenElement('table', array('id' => 'sv-ext') );
foreach ( $extensionTypes as $type => $text ) {
- if ( count( @$wgExtensionCredits[$type] ) ) {
+ if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) {
$out .= $this->openExtType( $text );
usort( $wgExtensionCredits[$type], array( $this, 'compare' ) );
foreach ( $wgExtensionCredits[$type] as $extension ) {
- wfSuppressWarnings();
$out .= $this->formatCredits(
- $extension['name'],
- $extension['version'],
- $extension['author'],
- $extension['url'],
- $extension['description']
+ isset ( $extension['name'] ) ? $extension['name'] : '',
+ isset ( $extension['version'] ) ? $extension['version'] : null,
+ isset ( $extension['author'] ) ? $extension['author'] : '',
+ isset ( $extension['url'] ) ? $extension['url'] : null,
+ isset ( $extension['description'] ) ? $extension['description'] : ''
);
- wfRestoreWarnings();
}
}
}
foreach ($myWgHooks as $hook => $hooks)
$ret .= "<tr><td>$hook</td><td>" . $this->listToText( $hooks ) . "</td></tr>\n";
+ $ret .= '</table>';
return $ret;
} else
return '';
function listToText( $list ) {
$cnt = count( $list );
- if ( $cnt == 1 )
+ if ( $cnt == 1 ) {
// Enforce always returning a string
return (string)$this->arrayToString( $list[0] );
- elseif ( $cnt == 0 ) {
+ } elseif ( $cnt == 0 ) {
return '';
- else {
+ } else {
$t = array_slice( $list, 0, $cnt - 1 );
$one = array_map( array( &$this, 'arrayToString' ), $t );
$two = $this->arrayToString( $list[$cnt - 1] );
* @return mixed
*/
function arrayToString( $list ) {
- if ( ! is_array( $list ) )
+ if ( ! is_array( $list ) ) {
return $list;
- else {
+ } else {
$class = get_class( $list[0] );
return "($class, {$list[1]})";
}
return false;
}
- // SimpleXml whines about the xmlns...
- wfSuppressWarnings();
- $xml = simplexml_load_file( $entries );
- wfRestoreWarnings();
+ $xml = simplexml_load_file( $entries, "SimpleXMLElement", LIBXML_NOWARNING );
if( $xml ) {
foreach( $xml->entry as $entry ) {