From a5ebe1f73697662752ebe2578e6f172d717436e3 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 27 Feb 2010 16:15:41 +0000 Subject: [PATCH] * (bugs 22665 and 22667) User '0' can now be unblocked and have its block settings changed --- RELEASE-NOTES | 2 ++ includes/Block.php | 4 ++-- includes/specials/SpecialBlockip.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 45171def1e..1d79a61f67 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -25,6 +25,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN updating DB * (bug 22666) Submitting user block form with an invalid user name no longer throws an error +* (bugs 22665 and 22667) User '0' can now be unblocked and have its block + settings changed == API changes in 1.17 == diff --git a/includes/Block.php b/includes/Block.php index 74a3b58094..b8d97a573a 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -160,7 +160,7 @@ class Block { $options = array(); $db =& $this->getDBOptions( $options ); - if ( 0 == $user && $address == '' ) { + if ( 0 == $user && $address === '' ) { # Invalid user specification, not blocked $this->clear(); return false; @@ -178,7 +178,7 @@ class Block { # Try IP block # TODO: improve performance by merging this query with the autoblock one # Slightly tricky while handling killExpired as well - if ( $address ) { + if ( $address !== '' ) { $conds = array( 'ipb_address' => $address, 'ipb_auto' => 0 ); $res = $db->resultObject( $db->select( 'ipblocks', '*', $conds, __METHOD__, $options ) ); diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 1e56fa6cac..f8d7ac357f 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -105,7 +105,7 @@ class IPBlockForm { $msg = wfMsgReal( $key, $err ); $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) ); $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) ); - } elseif( $this->BlockAddress ) { + } elseif( $this->BlockAddress !== null ) { # Get other blocks, i.e. from GlobalBlocking or TorBlock extension wfRunHooks( 'OtherBlockLogLink', array( &$otherBlockedMsgs, $this->BlockAddress ) ); -- 2.20.1