User "Jack Phoenix" posted a comment on MediaWiki.r88927.
Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88927#c17221
Commit summary:
bugfix: injected illegal tags
Comment:
<pre>
+ $doc = @DOMDocument::loadHTML( $text );
</pre>
[[Manual:Coding conventions#Error handling|Don't use @, use
wfSuppressWarnings() and wfRestoreWarnings() instead.]]
<pre>
+ $body = $xpath -> query( '/html/body' );
+
+ $text = '';
+ foreach ( $body -> item( 0 ) -> childNodes as $child ) {
+ $text .= $doc -> saveXML( $child );
+ }
</pre>
This is ''too'' spacey, and should be written like this instead:
<pre>
$body = $xpath->query( '/html/body' );
$text = '';
foreach ( $body->item( 0 )->childNodes as $child ) {
$text .= $doc->saveXML( $child );
}
</pre>
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview