Follow up r64982. Autoblocks aren't automatically set just by storing ipb_enable_auto...
authorPlatonides <platonides@users.mediawiki.org>
Sat, 17 Apr 2010 20:59:05 +0000 (20:59 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 17 Apr 2010 20:59:05 +0000 (20:59 +0000)
So do this properly and use Block class to insert the block.

includes/Block.php

index 2367525..7ec7b6f 100644 (file)
@@ -377,9 +377,10 @@ class Block {
         *
         * @return Boolean: whether or not the insertion was successful.
         */
-       public function insert() {
+       public function insert($dbw = null) {
                wfDebug( "Block::insert; timestamp {$this->mTimestamp}\n" );
-               $dbw = wfGetDB( DB_MASTER );
+               if ( $dbw === null)
+                       $dbw = wfGetDB( DB_MASTER );
 
                $this->validateBlockParams();
                $this->initialiseRange();