From: Tim Starling Date: Fri, 27 Feb 2004 08:25:56 +0000 (+0000) Subject: fixed problem with updateTimestamp() altering existing IP blocks X-Git-Tag: 1.3.0beta1~938 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=f24e9a2cfae51d9762bed3eaa6db8b64029556c4;p=lhc%2Fweb%2Fwiklou.git fixed problem with updateTimestamp() altering existing IP blocks --- diff --git a/includes/Block.php b/includes/Block.php index 0f688a02c4..d98b07baeb 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -191,17 +191,19 @@ class Block return $this->mAddress != ""; } - function updateTimestamp() { - - $this->mTimestamp = wfTimestampNow(); - $this->mExpiry = Block::getAutoblockExpiry( $this->mTimestamp ); - - wfQuery( "UPDATE ipblocks SET " . - "ipb_timestamp='" . $this->mTimestamp . "', " . - "ipb_expiry='" . $this->mExpiry . "' " . - "WHERE ipb_address='" . wfStrencode( $this->mAddress ) . "'", DB_WRITE, "Block::updateTimestamp" ); - - $this->clearCache(); + function updateTimestamp() + { + if ( $this->mAuto ) { + $this->mTimestamp = wfTimestampNow(); + $this->mExpiry = Block::getAutoblockExpiry( $this->mTimestamp ); + + wfQuery( "UPDATE ipblocks SET " . + "ipb_timestamp='" . $this->mTimestamp . "', " . + "ipb_expiry='" . $this->mExpiry . "' " . + "WHERE ipb_address='" . wfStrencode( $this->mAddress ) . "'", DB_WRITE, "Block::updateTimestamp" ); + + $this->clearCache(); + } } /* private */ function clearCache()