From 1427dd0d42c7e064ddf2f3e91893c2240edf6078 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Tue, 20 Dec 2011 10:15:18 +0000 Subject: [PATCH] (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. --- RELEASE-NOTES-1.19 | 2 ++ includes/specials/SpecialBlock.php | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 55cc0c3a82..4f90d99f5d 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -189,6 +189,8 @@ production. causes the first log type requested to be removed but not the others * Use separate message ('prefixindex-namespace') for title of Special:PrefixIndex rather then re-using Special:AllPages's allinnamespace +* (bug 33156) Special:Block now allows you to confirm you want to block yourself + when using non-normalized username === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index fab295ac08..eac382a59f 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -565,9 +565,13 @@ class SpecialBlock extends FormSpecialPage { # Give admins a heads-up before they go and block themselves. Much messier # to do this for IPs, but it's pretty unlikely they'd ever get the 'block' - # permission anyway, although the code does allow for it + # permission anyway, although the code does allow for it. + # Note: Important to use $target instead of $data['Target'] + # since both $data['PreviousTarget'] and $target are normalized + # but $data['target'] gets overriden by (non-normalized) request variable + # from previous request. if( $target === $performer->getName() && - ( $data['PreviousTarget'] !== $data['Target'] || !$data['Confirm'] ) ) + ( $data['PreviousTarget'] !== $target || !$data['Confirm'] ) ) { return array( 'ipb-blockingself' ); } -- 2.20.1