From 128e9340d90a823079a51960a2808ec37a06f3f7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 11 Jul 2006 18:35:35 +0000 Subject: [PATCH] Block form fixlets: * Use wfCheckLabel() for proper checkbox formatting * Gracefully handle invalid username --- includes/SpecialBlockip.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index c7f25b964b..943d1d0a13 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -73,8 +73,6 @@ class IPBlockForm { $mIpbothertime = wfMsgHtml( 'ipbotheroption' ); $mIpbreason = wfMsgHtml( 'ipbreason' ); $mIpbsubmit = wfMsgHtml( 'ipbsubmit' ); - $mIpbanononly = wfMsgHtml( 'ipbanononly' ); - $mIpbcreateaccount = wfMsgHtml( 'ipbcreateaccount' ); $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' ); $action = $titleObj->escapeLocalURL( "action=submit" ); @@ -88,8 +86,6 @@ class IPBlockForm { $scBlockReason = htmlspecialchars( $this->BlockReason ); $scBlockOtherTime = htmlspecialchars( $this->BlockOther ); $scBlockExpiryOptions = htmlspecialchars( wfMsgForContent( 'ipboptions' ) ); - $anonOnlyChecked = $this->BlockAnonOnly ? 'checked' : ''; - $createAccountChecked = $this->BlockCreateAccount ? 'checked' : ''; $showblockoptions = $scBlockExpiryOptions != '-'; if (!$showblockoptions) @@ -146,19 +142,15 @@ class IPBlockForm {   - + " . wfCheckLabel( wfMsg( 'ipbanononly' ), + 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly ) . "   - + " . wfCheckLabel( wfMsg( 'ipbcreateaccount' ), + 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount ) . " @@ -198,7 +190,7 @@ class IPBlockForm { # Username block if ( $wgSysopUserBans ) { $user = User::newFromName( $this->BlockAddress ); - if ( $user->getID() ) { + if( !is_null( $user ) && $user->getID() ) { # Use canonical name $this->BlockAddress = $user->getName(); } else { -- 2.20.1