* replace use of deprecated makeLinkObj() by link() in core
[lhc/web/wiklou.git] / includes / Block.php
index 9423b88..5c2b52f 100644 (file)
@@ -105,6 +105,7 @@ class Block {
                        && $this->mHideName == $block->mHideName
                        && $this->mBlockEmail == $block->mBlockEmail
                        && $this->mAllowUsertalk == $block->mAllowUsertalk
+                       && $this->mReason == $block->mReason
                );
        }
 
@@ -452,9 +453,12 @@ class Block {
                # Unset ipb_enable_autoblock for IP blocks, makes no sense
                if ( !$this->mUser ) {
                        $this->mEnableAutoblock = 0;
-                       $this->mBlockEmail = 0; //Same goes for email...
+                       
+               }
+               # bug 18860: non-anon-only IP blocks should be allowed to block email
+               if ( !$this->mUser && $this->mAnonOnly ) {
+                       $this->mBlockEmail = 0;
                }
-
                if( !$this->mByName ) {
                        if( $this->mBy ) {
                                $this->mByName = User::whoIs( $this->mBy );
@@ -822,7 +826,7 @@ class Block {
         * Convert a DB-encoded expiry into a real string that humans can read.
         *
         * @param $encoded_expiry String: Database encoded expiry time
-        * @return String
+        * @return Html-escaped String
         */
        public static function formatExpiry( $encoded_expiry ) {
                static $msg = null;
@@ -840,8 +844,9 @@ class Block {
                        $expirystr = $msg['infiniteblock'];
                } else {
                        global $wgLang;
-                       $expiretimestr = $wgLang->timeanddate( $expiry, true );
-                       $expirystr = wfMsgReplaceArgs( $msg['expiringblock'], array($expiretimestr) );
+                       $expiredatestr = htmlspecialchars($wgLang->date( $expiry, true ));
+                       $expiretimestr = htmlspecialchars($wgLang->time( $expiry, true ));
+                       $expirystr = wfMsgReplaceArgs( $msg['expiringblock'], array( $expiredatestr, $expiretimestr ) );
                }
                return $expirystr;
        }