r106774 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106773‎ | r106774 | r106775 >
Date:10:15, 20 December 2011
Author:bawolff
Status:ok
Tags:
Comment:
(bug 33156) Special:block didn't let you confirm blocking yourself if using non-normalized name.

Was comparing the normalized name to the non-normalized name that gets inserted into the form, since
request variables from previous request override form defaults.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlock.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -189,6 +189,8 @@
190190 causes the first log type requested to be removed but not the others
191191 * Use separate message ('prefixindex-namespace') for title of
192192 Special:PrefixIndex rather then re-using Special:AllPages's allinnamespace
 193+* (bug 33156) Special:Block now allows you to confirm you want to block yourself
 194+ when using non-normalized username
193195
194196 === API changes in 1.19 ===
195197 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/specials/SpecialBlock.php
@@ -565,9 +565,13 @@
566566
567567 # Give admins a heads-up before they go and block themselves. Much messier
568568 # to do this for IPs, but it's pretty unlikely they'd ever get the 'block'
569 - # permission anyway, although the code does allow for it
 569+ # permission anyway, although the code does allow for it.
 570+ # Note: Important to use $target instead of $data['Target']
 571+ # since both $data['PreviousTarget'] and $target are normalized
 572+ # but $data['target'] gets overriden by (non-normalized) request variable
 573+ # from previous request.
570574 if( $target === $performer->getName() &&
571 - ( $data['PreviousTarget'] !== $data['Target'] || !$data['Confirm'] ) )
 575+ ( $data['PreviousTarget'] !== $target || !$data['Confirm'] ) )
572576 {
573577 return array( 'ipb-blockingself' );
574578 }

Sign-offs

UserFlagDate
Brion VIBBERtested19:53, 20 December 2011

Status & tagging log