w/s changes.
[lhc/web/wiklou.git] / includes / specials / SpecialBlock.php
index 0b01568..b481b90 100644 (file)
@@ -48,7 +48,7 @@ class SpecialBlock extends SpecialPage {
 
        /// @var Bool
        protected $alreadyBlocked;
-       
+
        /// @var Array
        protected $preErrors = array();
 
@@ -633,7 +633,7 @@ class SpecialBlock extends SpecialPage {
                $status = $block->insert();
                if( !$status ) {
                        # Show form unless the user is already aware of this...
-                       if( ( $data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) || !$data['Confirm'] ) {
+                       if( ( array_key_exists('PreviousTarget', $data ) && $data['PreviousTarget'] != htmlspecialchars( $block->getTarget() ) ) || !$data['Confirm'] ) {
                                return array( array( 'ipb_already_blocked', $block->getTarget() ) );
                        # Otherwise, try to update the block...
                        } else {
@@ -709,7 +709,7 @@ class SpecialBlock extends SpecialPage {
 
        /**
         * Get an array of suggested block durations from MediaWiki:Ipboptions
-        * FIXME: this uses a rather odd syntax for the options, should it be converted
+        * @todo FIXME: This uses a rather odd syntax for the options, should it be converted
         *     to the standard "**<duration>|<displayname>" format?
         * @return Array
         */
@@ -742,7 +742,7 @@ class SpecialBlock extends SpecialPage {
        public static function parseExpiryInput( $expiry ) {
                static $infinity;
                if( $infinity == null ){
-                       $infinity = wfGetDB( DB_READ )->getInfinity();
+                       $infinity = wfGetDB( DB_SLAVE )->getInfinity();
                }
                if ( $expiry == 'infinite' || $expiry == 'indefinite' ) {
                        $expiry = $infinity;