* (bug 1204) Blocks do not expire automatically
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 11 Jan 2005 08:05:22 +0000 (08:05 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 11 Jan 2005 08:05:22 +0000 (08:05 +0000)
includes/Block.php

index 3f0ed48..61143f8 100644 (file)
@@ -58,6 +58,7 @@ class Block
        function load( $address = '', $user = 0, $killExpired = true ) 
        {
                $fname = 'Block::load';
+               wfDebug( "Block::load: '$address', '$user', $killExpired\n" );
 
                $ret = false;
                $killed = false;
@@ -219,19 +220,22 @@ class Block
        function deleteIfExpired() 
        {
                if ( $this->isExpired() ) {
+                       wfDebug( "Block::deleteIfExpired() -- deleting\n" );
                        $this->delete();
                        return true;
                } else {
+                       wfDebug( "Block::deleteIfExpired() -- not expired\n" );
                        return false;
                }
        }
 
        function isExpired() 
        {       
+               wfDebug( "Block::isExpired() checking current " . wfTimestampNow() . " vs $this->mExpiry\n" );
                if ( !$this->mExpiry ) {
                        return false;
                } else {
-                       return wfTimestamp() > $this->mExpiry;
+                       return wfTimestampNow() > $this->mExpiry;
                }
        }