Committed patch by Ting Chen to fix bug #856 (Auto-IP blocks last past the original...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 8 Oct 2005 14:45:51 +0000 (14:45 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 8 Oct 2005 14:45:51 +0000 (14:45 +0000)
includes/User.php

index 2aea2e9..43bc530 100644 (file)
@@ -1446,6 +1446,13 @@ class User {
                # Check if this IP address is already blocked
                $ipblock = Block::newFromDB( wfGetIP() );
                if ( $ipblock->isValid() ) {
+                       # If the user is already blocked. Then check if the autoblock would
+                       # excede the user block. If it would excede, then do nothing, else
+                       # prolong block time
+                       if ($userblock->mExpiry &&
+                               ($userblock->mExpiry < Block::getAutoblockExpiry($ipblock->mTimestamp))) {
+                               return;
+                       }
                        # Just update the timestamp
                        $ipblock->updateTimestamp();
                        return;