r96501 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96500‎ | r96501 | r96502 >
Date:21:14, 7 September 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix whitespace

Swap xor for ^

Documentation
Modified paths:
  • /trunk/extensions/ClickTracking/modules/ext.UserBuckets.js (modified) (history)
  • /trunk/extensions/CodeReview/backend/DiffHighlighter.php (modified) (history)
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.php (modified) (history)
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)
  • /trunk/phase3/includes/logging/LogFormatter.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/maintenance/namespaceDupes.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/namespaceDupes.php
@@ -26,6 +26,12 @@
2727 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
2828
2929 class NamespaceConflictChecker extends Maintenance {
 30+
 31+ /**
 32+ * @var DatabaseBase
 33+ */
 34+ protected $db;
 35+
3036 public function __construct() {
3137 parent::__construct();
3238 $this->mDescription = "";
@@ -183,6 +189,8 @@
184190 *
185191 * @param $ns Integer: namespace id (id for new namespace?)
186192 * @param $name String: prefix that is being made a namespace
 193+ *
 194+ * @return array
187195 */
188196 private function getConflicts( $ns, $name ) {
189197 $page = 'page';
@@ -217,6 +225,8 @@
218226
219227 /**
220228 * Report any conflicts we find
 229+ *
 230+ * @return bool
221231 */
222232 private function reportConflict( $row, $suffix ) {
223233 $newTitle = Title::makeTitleSafe( $row->namespace, $row->title );
Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -76,7 +76,7 @@
7777 warnings/notices to be thrown.
7878 * (bug 30335) Fix for HTMLForms using GET breaking when non-friendly URLs are
7979 used
80 -* (bug 28649) Avoiding half truncated multi-byte unicode characters when
 80+* (bug 28649) Avoiding half truncated multi-byte unicode characters when
8181 truncating log comments.
8282 * Show --batch-size option in help of maintenance scripts that support it
8383 * (bug 4381) Magic quotes cleaning was not comprehensive, key strings were not
Index: trunk/phase3/includes/logging/LogFormatter.php
@@ -56,7 +56,9 @@
5757
5858 // Nonstatic->
5959
60 - /// @var LogEntry
 60+ /**
 61+ * @var LogEntry
 62+ */
6163 protected $entry;
6264
6365 /// Whether to output user tool links
Index: trunk/phase3/includes/api/ApiMain.php
@@ -428,7 +428,7 @@
429429 return;
430430 } // else no XVO and anonymous, send public headers below
431431 }
432 -
 432+
433433 // Send public headers
434434 if ( $wgVaryOnXFPForAPI ) {
435435 $response->header( 'Vary: Accept-Encoding, X-Forwarded-Proto' );
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -377,7 +377,7 @@
378378 return false;
379379 }
380380
381 - // Hook point to check for exempt from account creation throttle
 381+ // Hook point to check for exempt from account creation throttle
382382 if ( !wfRunHooks( 'exemptFromAccountCreationThrottle', array( $ip ) ) ) {
383383 wfDebug( "LoginForm::exemptFromAccountCreationThrottle: a hook allowed account creation w/o throttle\n" );
384384 } else {
@@ -780,7 +780,6 @@
781781 * @param $emailTitle String: message name of email title
782782 * @param $emailText String: message name of email text
783783 * @return Status object
784 - * @private
785784 */
786785 function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
787786 global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry, $wgRequest;
Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -29,7 +29,7 @@
3030 'password' => $wgMetricsDBpassword,
3131 'dbname' => $wgMetricsDBname,
3232 'tablePrefix' => $wgMetricsDBprefix,
33 - 'flags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT
 33+ 'flags' => ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT,
3434 )
3535 );
3636 //$this->mDb->query( "SET names utf8" );
Index: trunk/extensions/ClickTracking/modules/ext.UserBuckets.js
@@ -2,7 +2,7 @@
33 //lazy-load
44 $.getBuckets = function (force){
55 if ( typeof $.userBuckets == 'undefined' || force ){
6 - $.userBuckets = $.parseJSON( $.cookie('userbuckets') );
 6+ $.userBuckets = $.parseJSON( $.cookie('userbuckets') );
77 }
88 return $.userBuckets;
99 };
@@ -26,21 +26,21 @@
2727 if ( campaign.all ){
2828 campaign.all();
2929 }
30 -
 30+
3131 if ( campaign.preferences && !campaign.preferences.setBuckets ) {
3232 continue;
3333 }
34 -
 34+
3535 if ( !buckets || !buckets[campaign.name] || buckets[campaign.name][1] < campaign.version){
3636 // Add up all rates
3737 var bucketTotal = 0;
3838 for ( var rate in campaign.rates ){
3939 bucketTotal += campaign.rates[rate];
4040 }
41 -
 41+
4242 // Give the user a random number in those rates
4343 var currentUser = Math.floor( Math.random() * (bucketTotal+1) );
44 -
 44+
4545 // recurse through the rates until we get into the range the user falls in,
4646 // assign them to that range
4747 var prev_val = -1;
@@ -54,13 +54,13 @@
5555 prev_val = next_val;
5656 }
5757 }
58 -
 58+
5959 // Execute the actual code in the campaign based on the bucket
6060 if ( $.getBuckets() && $.getBuckets()[campaign.name] ) {
6161
6262 var campaignBucket = $.getBuckets()[campaign.name][0];
6363 if ( campaignBucket != 'none' ) {
64 -
 64+
6565 // Function to execute
6666 var func = campaign[campaignBucket];
6767 if ( $.isFunction( func ) ) {
@@ -71,9 +71,9 @@
7272 }
7373 }
7474 }
75 -
 75+
7676 }
77 -
 77+
7878 };
7979
8080 // No need to do any of this if there are no active campaigns
@@ -81,5 +81,4 @@
8282 $( $.setupActiveBuckets );
8383 }
8484
85 -
8685 } )( jQuery );
Index: trunk/extensions/UploadWizard/UploadWizard.php
@@ -28,8 +28,6 @@
2929 'url' => 'http://www.mediawiki.org/wiki/Extension:UploadWizard'
3030 );
3131
32 -
33 -
3432 $wgUpwizDir = dirname( __FILE__ );
3533
3634 $wgExtensionMessagesFiles['UploadWizard'] = $wgUpwizDir . '/UploadWizard.i18n.php';
@@ -80,7 +78,7 @@
8179 $wgGroupPermissions['sysop' ]['upwizcampaigns'] = true;
8280 $wgGroupPermissions['upwizcampeditors']['upwizcampaigns'] = true;
8381
84 -// Init the upload wizard config array
 82+// Init the upload wizard config array
8583 // UploadWizard.config.php includes default configuration
8684 // any value can be modified in localSettings.php by setting $wgUploadWizardConfig['name'] = 'value;
8785 $wgUploadWizardConfig = array();
Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php
@@ -35,7 +35,7 @@
3636 * @return string
3737 */
3838 function render( $text, CodeRepository $repo = null, CodeRevision $rev = null ) {
39 - if( $repo xor $rev ) {
 39+ if( $repo ^ $rev ) {
4040 throw new MWException( __METHOD__ . " must have both repository and revision or none of them\n" );
4141 } elseif( $repo && $rev ) {
4242 $this->repo = $repo;

Follow-up revisions

RevisionCommit summaryAuthorDate
r96504Fix xor in r96501reedy21:37, 7 September 2011

Comments

#Comment by Bryan (talk | contribs)   21:35, 7 September 2011

xor is not equivalent to ^; the former is logical, the latter is bitwise

#Comment by Hashar (talk | contribs)   15:05, 12 September 2011

Next time please use two different commits :-)

Status & tagging log