- wfStrencode( $this->BlockReason ), wfTimestampNow(), 0, $expiry );
- $ban->insert();
-
- # Make log entry
- $log = new LogPage( wfMsg( "blocklogpage" ), wfMsg( "blocklogtext" ) );
- $action = wfMsg( "blocklogentry", $this->BlockAddress, $this->BlockExpiry );
- $log->addEntry( $action, $this->BlockReason );
-
- # Report to the user
- $titleObj = Title::makeTitle( NS_SPECIAL, "Blockip" );
- $wgOut->redirect( $titleObj->getFullURL( "action=success&ip={$this->BlockAddress}" ) );
+ $this->BlockReason, wfTimestampNow(), 0, $expiry );
+
+ if (wfRunHooks('BlockIp', array(&$ban, &$wgUser))) {
+
+ $ban->insert();
+
+ wfRunHooks('BlockIpComplete', array($ban, $wgUser));
+
+ # Make log entry
+ $log = new LogPage( 'block' );
+ $log->addEntry( 'block', Title::makeTitle( NS_USER, $this->BlockAddress ),
+ $this->BlockReason, $this->BlockExpiry );
+
+ # Report to the user
+ $titleObj = Title::makeTitle( NS_SPECIAL, 'Blockip' );
+ $wgOut->redirect( $titleObj->getFullURL( 'action=success&ip=' .
+ urlencode( $this->BlockAddress ) ) );
+ }