r19003 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19002‎ | r19003 | r19004 >
Date:04:11, 9 January 2007
Author:nickj
Status:old
Tags:
Comment:
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() [<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
Modified paths:
  • /trunk/phase3/includes/SpecialLockdb.php (modified) (history)
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialLockdb.php
@@ -126,7 +126,7 @@
127127 $wgOut->addWikiText( wfMsg( 'lockdbsuccesstext' ) );
128128 }
129129
130 - function notWritable() {
 130+ public static function notWritable() {
131131 global $wgOut;
132132 $wgOut->errorPage( 'lockdb', 'lockfilenotwritable' );
133133 }
Index: trunk/phase3/includes/SpecialVersion.php
@@ -110,21 +110,19 @@
111111 $out .= wfOpenElement('table', array('id' => 'sv-ext') );
112112
113113 foreach ( $extensionTypes as $type => $text ) {
114 - if ( count( @$wgExtensionCredits[$type] ) ) {
 114+ if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) {
115115 $out .= $this->openExtType( $text );
116116
117117 usort( $wgExtensionCredits[$type], array( $this, 'compare' ) );
118118
119119 foreach ( $wgExtensionCredits[$type] as $extension ) {
120 - wfSuppressWarnings();
121120 $out .= $this->formatCredits(
122 - $extension['name'],
123 - $extension['version'],
124 - $extension['author'],
125 - $extension['url'],
126 - $extension['description']
 121+ isset ( $extension['name'] ) ? $extension['name'] : '',
 122+ isset ( $extension['version'] ) ? $extension['version'] : '',
 123+ isset ( $extension['author'] ) ? $extension['author'] : '',
 124+ isset ( $extension['url'] ) ? $extension['url'] : '',
 125+ isset ( $extension['description'] ) ? $extension['description'] : ''
127126 );
128 - wfRestoreWarnings();
129127 }
130128 }
131129 }
@@ -292,10 +290,7 @@
293291 return false;
294292 }
295293
296 - // SimpleXml whines about the xmlns...
297 - wfSuppressWarnings();
298 - $xml = simplexml_load_file( $entries );
299 - wfRestoreWarnings();
 294+ $xml = simplexml_load_file( $entries, "SimpleXMLElement", LIBXML_NOWARNING );
300295
301296 if( $xml ) {
302297 foreach( $xml->entry as $entry ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r21629* (bug 9682) Revert PHP 5.1 dependency on warning suppression for SVN info...brion18:16, 26 April 2007