Merge "WebInstallerOutput: Add getLanguage()"
[lhc/web/wiklou.git] / includes / Block.php
index eb8214b..7138301 100644 (file)
@@ -1132,6 +1132,7 @@ class Block {
         * prohibited from editing any page on the site (other than their own talk
         * page).
         *
+        * @since 1.33
         * @param null|bool $x
         * @return bool
         */
@@ -1168,7 +1169,12 @@ class Block {
                                $res = $this->isSitewide();
                                break;
                        case 'editownusertalk':
+                               // NOTE: this check is not reliable on partial blocks
+                               // since partially blocked users are always allowed to edit
+                               // their own talk page unless a restriction exists on the
+                               // page or User_talk: namespace
                                $res = wfSetVar( $this->mDisableUsertalk, $x );
+
                                // edit own user talk can be disabled by config
                                if ( !$blockAllowsUTEdit ) {
                                        $res = true;
@@ -1301,7 +1307,7 @@ class Block {
         * @since 1.22
         */
        public static function getBlocksForIPList( array $ipChain, $isAnon, $fromMaster = false ) {
-               if ( !count( $ipChain ) ) {
+               if ( $ipChain === [] ) {
                        return [];
                }
 
@@ -1326,7 +1332,7 @@ class Block {
                        $conds[] = self::getRangeCond( IP::toHex( $ipaddr ) );
                }
 
-               if ( !count( $conds ) ) {
+               if ( $conds === [] ) {
                        return [];
                }
 
@@ -1382,7 +1388,7 @@ class Block {
         * @return Block|null The "best" block from the list
         */
        public static function chooseBlock( array $blocks, array $ipChain ) {
-               if ( !count( $blocks ) ) {
+               if ( $blocks === [] ) {
                        return null;
                } elseif ( count( $blocks ) == 1 ) {
                        return $blocks[0];
@@ -1723,6 +1729,7 @@ class Block {
        /**
         * Get block information used in different block error messages
         *
+        * @since 1.33
         * @param IContextSource $context
         * @return array
         */
@@ -1764,6 +1771,7 @@ class Block {
         * Getting the restrictions will perform a database query if the restrictions
         * are not already loaded.
         *
+        * @since 1.33
         * @return Restriction[]
         */
        public function getRestrictions() {
@@ -1782,8 +1790,8 @@ class Block {
        /**
         * Set Restrictions.
         *
+        * @since 1.33
         * @param Restriction[] $restrictions
-        *
         * @return self
         */
        public function setRestrictions( array $restrictions ) {