Merge "Surround edit notices with appropriate classes"
[lhc/web/wiklou.git] / includes / Block.php
index 3c80035..4698f45 100644 (file)
@@ -113,7 +113,7 @@ class Block {
                        $this->forcedTargetID = $user; // needed for foreign users
                }
                if ( $by ) { // local user
-                       $this->setBlocker( User::newFromID( $by ) );
+                       $this->setBlocker( User::newFromId( $by ) );
                } else { // foreign user
                        $this->setBlocker( $byText );
                }
@@ -366,7 +366,7 @@ class Block {
        protected function initFromRow( $row ) {
                $this->setTarget( $row->ipb_address );
                if ( $row->ipb_by ) { // local user
-                       $this->setBlocker( User::newFromID( $row->ipb_by ) );
+                       $this->setBlocker( User::newFromId( $row->ipb_by ) );
                } else { // foreign user
                        $this->setBlocker( $row->ipb_by_text );
                }
@@ -580,7 +580,7 @@ class Block {
                if ( $this->isAutoblocking() && $this->getType() == self::TYPE_USER ) {
                        wfDebug( "Doing retroactive autoblocks for " . $this->getTarget() . "\n" );
 
-                       $continue = wfRunHooks(
+                       $continue = Hooks::run(
                                'PerformRetroactiveAutoblock', array( $this, &$blockIds ) );
 
                        if ( $continue ) {
@@ -693,7 +693,7 @@ class Block {
                }
 
                # Allow hooks to cancel the autoblock.
-               if ( !wfRunHooks( 'AbortAutoblock', array( $autoblockIP, &$this ) ) ) {
+               if ( !Hooks::run( 'AbortAutoblock', array( $autoblockIP, &$this ) ) ) {
                        wfDebug( "Autoblock aborted by hook.\n" );
                        return false;
                }
@@ -752,7 +752,6 @@ class Block {
         * @return bool
         */
        public function deleteIfExpired() {
-               wfProfileIn( __METHOD__ );
 
                if ( $this->isExpired() ) {
                        wfDebug( "Block::deleteIfExpired() -- deleting\n" );
@@ -763,7 +762,6 @@ class Block {
                        $retVal = false;
                }
 
-               wfProfileOut( __METHOD__ );
                return $retVal;
        }
 
@@ -1055,7 +1053,6 @@ class Block {
                        return array();
                }
 
-               wfProfileIn( __METHOD__ );
                $conds = array();
                foreach ( array_unique( $ipChain ) as $ipaddr ) {
                        # Discard invalid IP addresses. Since XFF can be spoofed and we do not
@@ -1077,7 +1074,6 @@ class Block {
                }
 
                if ( !count( $conds ) ) {
-                       wfProfileOut( __METHOD__ );
                        return array();
                }
 
@@ -1108,7 +1104,6 @@ class Block {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                return $blocks;
        }
 
@@ -1140,8 +1135,6 @@ class Block {
                        return $blocks[0];
                }
 
-               wfProfileIn( __METHOD__ );
-
                // Sort hard blocks before soft ones and secondarily sort blocks
                // that disable account creation before those that don't.
                usort( $blocks, function ( Block $a, Block $b ) {
@@ -1222,11 +1215,9 @@ class Block {
                } elseif ( $blocksList['auto'] ) {
                        $chosenBlock = $blocksList['auto'];
                } else {
-                       wfProfileOut( __METHOD__ );
                        throw new MWException( "Proxy block found, but couldn't be classified." );
                }
 
-               wfProfileOut( __METHOD__ );
                return $chosenBlock;
        }