Merge "(bug 37755) Set robot meta tags for 'view source' pages"
[lhc/web/wiklou.git] / includes / Block.php
index 6e8f9f3..e05b2ac 100644 (file)
@@ -164,7 +164,7 @@ class Block {
 
        /**
         * Check if two blocks are effectively equal.  Doesn't check irrelevant things like
-        * the blocking user or the block timestamp, only things which affect the blocked user   *
+        * the blocking user or the block timestamp, only things which affect the blocked user
         *
         * @param $block Block
         *
@@ -231,6 +231,7 @@ class Block {
         *     3) An autoblock on the given IP
         * @param $vagueTarget User|String also search for blocks affecting this target.  Doesn't
         *     make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
+        * @throws MWException
         * @return Bool whether a relevant block was found
         */
        protected function newLoad( $vagueTarget = null ) {
@@ -426,6 +427,7 @@ class Block {
        /**
         * Delete the row from the IP blocks table.
         *
+        * @throws MWException
         * @return Boolean
         */
        public function delete() {
@@ -534,10 +536,10 @@ class Block {
                        'ipb_expiry'           => $expiry,
                        'ipb_range_start'      => $this->getRangeStart(),
                        'ipb_range_end'        => $this->getRangeEnd(),
-                       'ipb_deleted'          => intval( $this->mHideName ), // typecast required for SQLite
+                       'ipb_deleted'          => intval( $this->mHideName ), // typecast required for SQLite
                        'ipb_block_email'      => $this->prevents( 'sendemail' ),
                        'ipb_allow_usertalk'   => !$this->prevents( 'editownusertalk' ),
-                       'ipb_parent_block_id'            => $this->mParentBlockId
+                       'ipb_parent_block_id'  => $this->mParentBlockId
                );
 
                return $a;
@@ -780,6 +782,7 @@ class Block {
 
        /**
         * Get the IP address at the start of the range in Hex form
+        * @throws MWException
         * @return String IP in Hex form
         */
        public function getRangeStart() {
@@ -797,6 +800,7 @@ class Block {
 
        /**
         * Get the IP address at the start of the range in Hex form
+        * @throws MWException
         * @return String IP in Hex form
         */
        public function getRangeEnd() {
@@ -1002,41 +1006,6 @@ class Block {
                return wfGetDB( DB_SLAVE )->getInfinity();
        }
 
-       /**
-        * Convert a DB-encoded expiry into a real string that humans can read.
-        *
-        * @param $encoded_expiry String: Database encoded expiry time
-        * @return Html-escaped String
-        * @deprecated since 1.18; use $wgLang->formatExpiry() instead
-        */
-       public static function formatExpiry( $encoded_expiry ) {
-               wfDeprecated( __METHOD__, '1.18' );
-
-               global $wgContLang;
-               static $msg = null;
-
-               if ( is_null( $msg ) ) {
-                       $msg = array();
-                       $keys = array( 'infiniteblock', 'expiringblock' );
-
-                       foreach ( $keys as $key ) {
-                               $msg[$key] = wfMessage( $key )->escaped();
-                       }
-               }
-
-               $expiry = $wgContLang->formatExpiry( $encoded_expiry, TS_MW );
-               if ( $expiry == wfGetDB( DB_SLAVE )->getInfinity() ) {
-                       $expirystr = $msg['infiniteblock'];
-               } else {
-                       global $wgLang;
-                       $expiredatestr = htmlspecialchars( $wgLang->date( $expiry, true ) );
-                       $expiretimestr = htmlspecialchars( $wgLang->time( $expiry, true ) );
-                       $expirystr = wfMsgReplaceArgs( $msg['expiringblock'], array( $expiredatestr, $expiretimestr ) );
-               }
-
-               return $expirystr;
-       }
-
        /**
         * Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute
         * ("24 May 2034"), into an absolute timestamp we can put into the database.