From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001
From: Pierre Schmitz <pierre@archlinux.de>
Date: Thu, 4 Jun 2015 07:31:04 +0200
Subject: Update to MediaWiki 1.25.1

---
 includes/password/PasswordFactory.php | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

(limited to 'includes/password/PasswordFactory.php')

diff --git a/includes/password/PasswordFactory.php b/includes/password/PasswordFactory.php
index 3b4ebb1a..86a3fefd 100644
--- a/includes/password/PasswordFactory.php
+++ b/includes/password/PasswordFactory.php
@@ -68,6 +68,15 @@ final class PasswordFactory {
 		$this->default = $type;
 	}
 
+	/**
+	 * Get the default password type
+	 *
+	 * @return string
+	 */
+	public function getDefaultType() {
+		return $this->default;
+	}
+
 	/**
 	 * Initialize the internal static variables using the global variables
 	 *
@@ -141,11 +150,15 @@ final class PasswordFactory {
 	 * If no existing object is given, make a new default object. If one is given, clone that
 	 * object. Then pass the plaintext to Password::crypt().
 	 *
-	 * @param string $password Plaintext password
+	 * @param string|null $password Plaintext password, or null for an invalid password
 	 * @param Password|null $existing Optional existing hash to get options from
 	 * @return Password
 	 */
 	public function newFromPlaintext( $password, Password $existing = null ) {
+		if ( $password === null ) {
+			return new InvalidPassword( $this, array( 'type' => '' ), null );
+		}
+
 		if ( $existing === null ) {
 			$config = $this->types[$this->default];
 			$obj = new $config['class']( $this, $config );
-- 
cgit v1.2.3-54-g00ecf