The effect of this bug is to reset a user's block from the start whenever they click "edit
this page". However, as I understand it, users do not find out *by software* that they are
blocked until they actually go to this edit page. As a result, their block does not always
technically start until they actually try to edit. And if they go back to an edit page to re-
read their block information (such as to get the name of the blocking administrator) the
block starts again on their current IP address. As far as I know, this is not the intended
effect of blocks.

I should add that this happens even when you're logged in under the username
that was originally blocked (logged in as User:trollinator). I'm not sure if
this should require a different report or not, but it would be helpful to
display a 'view source' that displays the source since they can't edit at the
time (same as when a page as protected). Yes, you can get an xml dump of the
page, from from a UI standpoint it makes more sense to have this option which
the users are used to.

I've encountered this behavior in the past but have only gotten a real grasp on
what is happening since I've examined the source code.

The problem is in User::spreadBlock() which is executed when
User::GetBlockedStatus() for a logged-in user determines that a user block is in
progress. The function User::spreadBlock() then looks to see if the IP address
is already blocked. If so, it calls Block::updateTimestamp(), which calls
Block::getAutoblockExpiry() to calculate the new expiry time. After checking
that the IP block was an autoblock, this simply adds the global constant
$wgAutoblockExpiry to the timestamp. The default value of this constant is
86400, which programmers will recognise as the number of seconds in a day.

By contrast, if the IP address was not already blocked, the autoblock expiry
time is only set to time+86400 if this is earlier than the user block expiry
time. This code should also be executed in Block::updateTimestamp(). I'm
fixing this in my test wiki now.

Add Comment

Text is available under the Creative Commons Attribution-ShareAlike 3.0 License; code is available under the GNU General Public License or other appropriate open source licenses. By using this site, you agree to the Terms of Use and Privacy Policy. · Wikimedia Foundation · Privacy Policy · Terms of Use · Disclaimer

Column Prototype

This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.