Tweaks to stop following warnings with PHP's E_STRICT error_reporting mode enabled:
authorNick Jenkins <nickj@users.mediawiki.org>
Tue, 9 Jan 2007 04:11:16 +0000 (04:11 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Tue, 9 Jan 2007 04:11:16 +0000 (04:11 +0000)
* Strict Standards: Non-static method DBLockForm::notWritable() should not be called statically in includes/SpecialLockdb.php on line 22
* Strict Standards: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]: /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() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]:    xmlns=&quot;svn:&quot;&gt; in includes/SpecialVersion.php on line 297
* Strict Standards: simplexml_load_file() [<a href='function.simplexml-load-file'>function.simplexml-load-file</a>]:                ^ 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

includes/SpecialLockdb.php
includes/SpecialVersion.php

index f0142e5..f4e0dd9 100644 (file)
@@ -126,7 +126,7 @@ END
                $wgOut->addWikiText( wfMsg( 'lockdbsuccesstext' ) );
        }
        
-       function notWritable() {
+       public static function notWritable() {
                global $wgOut;
                $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' );
        }
index dba694c..36da5ca 100644 (file)
@@ -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 ) {