r90693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90692‎ | r90693 | r90694 >
Date:07:49, 24 June 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Code style cleanups, use strict comparison with $data['PreviousTarget'] per CR
Modified paths:
  • /trunk/phase3/includes/specials/SpecialBlock.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialBlock.php
@@ -554,7 +554,8 @@
555555 # Give admins a heads-up before they go and block themselves. Much messier
556556 # to do this for IPs, but it's pretty unlikely they'd ever get the 'block'
557557 # permission anyway, although the code does allow for it
558 - if( $target === $wgUser->getName() && ( $data['PreviousTarget'] != $data['Target'] || !$data['Confirm'] ) )
 558+ if( $target === $wgUser->getName() &&
 559+ ( $data['PreviousTarget'] != $data['Target'] || !$data['Confirm'] ) )
559560 {
560561 return array( 'ipb-blockingself' );
561562 }
@@ -634,7 +635,9 @@
635636 $status = $block->insert();
636637 if( !$status ) {
637638 # Show form unless the user is already aware of this...
638 - if( ( array_key_exists('PreviousTarget', $data ) && $data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) || !$data['Confirm'] ) {
 639+ if( !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data )
 640+ && $data['PreviousTarget'] !== htmlspecialchars( $block->getTarget() ) ) )
 641+ {
639642 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
640643 # Otherwise, try to update the block...
641644 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89087PreviousTarget is now optional when blocking a user...hashar07:00, 29 May 2011

Comments

#Comment by Siebrand (talk | contribs)   09:40, 24 June 2011

Please associate the ref you referred to for "use strict comparison with $data['PreviousTarget'] per CR". Rev seems OK.

Status & tagging log