Merge "(bug 18195) Allow changing preferences via API"
[lhc/web/wiklou.git] / includes / User.php
index af923ff..793714d 100644 (file)
@@ -2281,7 +2281,10 @@ class User {
         * Reset all options to the site defaults
         */
        public function resetOptions() {
+               $this->load();
+
                $this->mOptions = self::getDefaultOptions();
+               $this->mOptionsLoaded = true;
        }
 
        /**
@@ -3924,7 +3927,7 @@ class User {
                } elseif ( $type == ':B:' ) {
                        # Salted
                        list( $salt, $realHash ) = explode( ':', substr( $hash, 3 ), 2 );
-                       return md5( $salt.'-'.md5( $password ) ) == $realHash;
+                       return md5( $salt.'-'.md5( $password ) ) === $realHash;
                } else {
                        # Old-style
                        return self::oldCrypt( $password, $userId ) === $hash;