disallow embedded line breaks in ISBNs; allowing them breaks things in a most interes...
[lhc/web/wiklou.git] / includes / SpecialIpblocklist.php
index 869d672..84d07ac 100644 (file)
@@ -167,6 +167,7 @@ class IPUnblockForm {
                }
 
                $conds = array();
+               $matches = array();
                if ( $this->ip == '' ) {
                        // No extra conditions
                } elseif ( substr( $this->ip, 0, 1 ) == '#' ) {
@@ -174,7 +175,7 @@ class IPUnblockForm {
                } elseif ( IP::toUnsigned( $this->ip ) !== false ) {
                        $conds['ipb_address'] = $this->ip;
                        $conds['ipb_auto'] = 0;
-               } elseif( preg_match( "/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/", $this->ip, $matches ) ) {
+               } elseif( preg_match( '/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/', $this->ip, $matches ) ) {
                        $conds['ipb_address'] = Block::normaliseRange( $this->ip );
                        $conds['ipb_auto'] = 0;
                } else {
@@ -234,8 +235,10 @@ class IPUnblockForm {
 
                wfProfileIn( __METHOD__ );
 
-               static $msg=null;
+               static $sk=null, $msg=null;
 
+               if( is_null( $sk ) )
+                       $sk = $wgUser->getSkin();
                if( is_null( $msg ) ) {
                        $msg = array();
                        $keys = array( 'infiniteblock', 'expiringblock', 'contribslink', 'unblocklink', 
@@ -248,16 +251,17 @@ class IPUnblockForm {
                }
 
                # Prepare links to the blocker's user and talk pages
+               $blocker_id = $block->getBy();
                $blocker_name = $block->getByName();
-               $blocker = Linker::makeLinkObj( Title::makeTitle( NS_USER, $blocker_name ), $blocker_name );
-               $blocker .= ' (' . Linker::makeLinkObj( Title::makeTitle( NS_USER_TALK, $blocker_name ), $wgLang->getNsText( NS_TALK ) ) . ')';
+               $blocker = $sk->userLink( $blocker_id, $blocker_name );
+               $blocker .= $sk->userToolLinks( $blocker_id, $blocker_name );
 
                # Prepare links to the block target's user and contribs. pages (as applicable, don't do it for autoblocks)
                if( $block->mAuto ) {
                        $target = $block->getRedactedName(); # Hide the IP addresses of auto-blocks; privacy
                } else {
-                       $target = Linker::makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress );
-                       $target .= ' (' . Linker::makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')';
+                       $target = $sk->makeLinkObj( Title::makeTitle( NS_USER, $block->mAddress ), $block->mAddress );
+                       $target .= ' (' . $sk->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $block->mAddress ), $msg['contribslink'] ) . ')';
                }
                
                $formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
@@ -275,7 +279,7 @@ class IPUnblockForm {
                if ( $block->mCreateAccount ) {
                        $properties[] = $msg['createaccountblock'];
                }
-               if (!$block->mEnableAutoblock && !$block->mAddress ) {
+               if (!$block->mEnableAutoblock && $block->mUser ) {
                        $properties[] = $msg['noautoblockblock'];
                }
 
@@ -287,9 +291,9 @@ class IPUnblockForm {
 
                if ( $wgUser->isAllowed('block') ) {
                        $titleObj = SpecialPage::getTitleFor( "Ipblocklist" );
-                       $s .= ' (' . Linker::makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
+                       $s .= ' (' . $sk->makeKnownLinkObj($titleObj, $msg['unblocklink'], 'action=unblock&id=' . urlencode( $block->mId ) ) . ')';
                }
-               $s .= Linker::commentBlock( $block->mReason );
+               $s .= $sk->commentBlock( $block->mReason );
                $s .= "</li>\n";
                wfProfileOut( __METHOD__ );
                return $s;