MediaWiki r20195 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r20194‎ | r20195 (on ViewVC)‎ | r20196 >
Date:11:24, 7 March 2007
Author:daniel
Status:old
Tags:
Comment:
added hook to isValidPassword (patch by Ger Apeldoorn, Bug 9180)
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/User.php
===================================================================
--- trunk/phase3/includes/User.php	(revision 20194)
+++ trunk/phase3/includes/User.php	(revision 20195)
@@ -464,7 +464,16 @@
 	 */
 	static function isValidPassword( $password ) {
 		global $wgMinimalPasswordLength;
-		return strlen( $password ) >= $wgMinimalPasswordLength;
+
+		$result = null;
+		if( !wfRunHooks( 'isValidPassword', array( $password, &$result ) ) ) return $result;
+		if ($result === false) return false; 
+		if (strlen( $password ) >= $wgMinimalPasswordLength) {
+			return true;
+		}
+		else {
+			return false;
+		}
 	}
 
 	/**
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox