From: Nick Jenkins Date: Tue, 9 Jan 2007 04:11:16 +0000 (+0000) Subject: Tweaks to stop following warnings with PHP's E_STRICT error_reporting mode enabled: X-Git-Tag: 1.31.0-rc.0~54562 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=65ad0d88833d919f58c818ec2b820927632d468c;p=lhc%2Fweb%2Fwiklou.git Tweaks to stop following warnings with PHP's E_STRICT error_reporting mode enabled: * Strict Standards: Non-static method DBLockForm::notWritable() should not be called statically in includes/SpecialLockdb.php on line 22 * Strict Standards: simplexml_load_file() [function.simplexml-load-file]: /var/www/hosts/mediawiki/wiki/.svn/entries:3: parser warning : xmlns: svn: not a valid URI in includes/SpecialVersion.php on line 297 * Strict Standards: simplexml_load_file() [function.simplexml-load-file]: xmlns="svn:"> in includes/SpecialVersion.php on line 297 * Strict Standards: simplexml_load_file() [function.simplexml-load-file]: ^ in includes/SpecialVersion.php on line 297 * Strict Standards: Undefined index: version in includes/SpecialVersion.php on line 122 * Strict Standards: Undefined index: url in includes/SpecialVersion.php on line 124 * Strict Standards: Undefined index: author in includes/SpecialVersion.php on line 123 * Strict Standards: Undefined index: description in includes/SpecialVersion.php on line 125 * Strict Standards: Undefined index: variable in includes/SpecialVersion.php on line 113 * Strict Standards: Undefined index: other in includes/SpecialVersion.php on line 113 --- diff --git a/includes/SpecialLockdb.php b/includes/SpecialLockdb.php index f0142e5ca5..f4e0dd9600 100644 --- a/includes/SpecialLockdb.php +++ b/includes/SpecialLockdb.php @@ -126,7 +126,7 @@ END $wgOut->addWikiText( wfMsg( 'lockdbsuccesstext' ) ); } - function notWritable() { + public static function notWritable() { global $wgOut; $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' ); } diff --git a/includes/SpecialVersion.php b/includes/SpecialVersion.php index dba694c058..36da5caf40 100644 --- a/includes/SpecialVersion.php +++ b/includes/SpecialVersion.php @@ -110,21 +110,19 @@ class SpecialVersion { $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'] : '', + isset ( $extension['author'] ) ? $extension['author'] : '', + isset ( $extension['url'] ) ? $extension['url'] : '', + isset ( $extension['description'] ) ? $extension['description'] : '' ); - wfRestoreWarnings(); } } } @@ -292,10 +290,7 @@ class SpecialVersion { 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 ) {