r87006 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87005‎ | r87006 | r87007 >
Date:11:11, 27 April 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Remove whitespace, unneeded globals, and swap and/or for &&/||
Modified paths:
  • /trunk/extensions/Cite/Cite_body.php (modified) (history)
  • /trunk/extensions/Cite/SpecialCite_body.php (modified) (history)
  • /trunk/extensions/ProfileMonitor/ProfileMonitor.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ProfileMonitor/ProfileMonitor.class.php
@@ -17,8 +17,6 @@
1818 public function execute( $par ) {
1919 global $wgOut, $wgRequest, $wgExtensionAssetsPath;
2020
21 -
22 -
2321 $this->setHeaders();
2422
2523 $process = $wgRequest->getText( 'process' );
Index: trunk/extensions/Cite/Cite_body.php
@@ -234,7 +234,7 @@
235235 return $this->error( 'cite_error_ref_too_many_keys' );
236236 }
237237
238 - if ( $str === null and $key === null ) {
 238+ if ( $str === null && $key === null ) {
239239 # Something like <ref />; this makes no sense.
240240 $this->mRefCallStack[] = false;
241241 return $this->error( 'cite_error_ref_no_key' );
@@ -269,7 +269,7 @@
270270 return $this->error( 'cite_error_included_ref' );
271271 }
272272
273 - if ( is_string( $key ) or is_string( $str ) ) {
 273+ if ( is_string( $key ) || is_string( $str ) ) {
274274 # We don't care about the content: if the key exists, the ref
275275 # is presumptively valid. Either it stores a new ref, or re-
276276 # fers to an existing one. If it refers to a nonexistent ref,
@@ -527,7 +527,7 @@
528528
529529 $this->mParser = $parser;
530530
531 - if ( isset( $argv['group'] ) and $wgAllowCiteGroups ) {
 531+ if ( isset( $argv['group'] ) && $wgAllowCiteGroups ) {
532532 $group = $argv['group'];
533533 unset ( $argv['group'] );
534534 }
@@ -595,7 +595,7 @@
596596 * @return string XHTML ready for output
597597 */
598598 function referencesFormat( $group ) {
599 - if ( ( count( $this->mRefs ) == 0 ) or ( empty( $this->mRefs[$group] ) ) ) {
 599+ if ( ( count( $this->mRefs ) == 0 ) || ( empty( $this->mRefs[$group] ) ) ) {
600600 return '';
601601 }
602602
Index: trunk/extensions/Cite/SpecialCite_body.php
@@ -1,8 +1,6 @@
22 <?php
33 if ( !defined( 'MEDIAWIKI' ) ) die();
44
5 -global $wgContLang, $wgContLanguageCode, $wgCiteDefaultText;
6 -
75 $dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
86 $code = $wgContLang->lc( $wgContLanguageCode );
97 $file = file_exists( "${dir}cite_text-$code" ) ? "${dir}cite_text-$code" : "${dir}cite_text";

Follow-up revisions

RevisionCommit summaryAuthorDate
r87120Partial revert r87006, for bug 28745reedy10:44, 29 April 2011

Comments

#Comment by P858snake (talk | contribs)   09:53, 29 April 2011

Bug 28745 - Breaks Cite.

Status & tagging log