Deprecate User::getPasswordValidity()
[lhc/web/wiklou.git] / includes / user / User.php
index 419e23b..ec75f05 100644 (file)
@@ -1144,8 +1144,8 @@ class User implements IDBAccessObject, UserIdentity {
         * @return bool
         */
        public function isValidPassword( $password ) {
-               // simple boolean wrapper for getPasswordValidity
-               return $this->getPasswordValidity( $password ) === true;
+               // simple boolean wrapper for checkPasswordValidity
+               return $this->checkPasswordValidity( $password )->isGood();
        }
 
        /**
@@ -1153,8 +1153,11 @@ class User implements IDBAccessObject, UserIdentity {
         *
         * @param string $password Desired password
         * @return bool|string|array True on success, string or array of error message on failure
+        * @deprecated since 1.33, use checkPasswordValidity
         */
        public function getPasswordValidity( $password ) {
+               wfDeprecated( __METHOD__, '1.33' );
+
                $result = $this->checkPasswordValidity( $password );
                if ( $result->isGood() ) {
                        return true;
@@ -2304,9 +2307,10 @@ class User implements IDBAccessObject, UserIdentity {
                                        if ( $block->isSitewide() ) {
                                                $blocked = $block->prevents( 'editownusertalk' );
                                        } else {
-                                               // If the block is partial, then only a true value is honored,
-                                               // otherwise fallback to the partial block settings.
-                                               $blocked = $block->prevents( 'editownusertalk' ) ?: $block->appliesToTitle( $title );
+                                               // If the block is partial, ignore 'editownusertalk' unless
+                                               // there is a restriction on the user talk namespace.
+                                               // TODO: To be implemented with Namespace restrictions
+                                               $blocked = $block->appliesToTitle( $title );
                                        }
                                } else {
                                        $blocked = $block->appliesToTitle( $title );