I don't see the problem. A hooked function call returning 'false' means
failure and all other functions attached to that hook are skipped. In such a
case, $result is null. A hooked function call returning true doesn't mean
that $result is true, it just means that it ran without running into
something considered exceptional.
Seeing that a password is invalid is not exceptional and the hook returns
true. $result is passed by reference, and will be what it should after the
hook is called. It can be true or false if the hook ran within normal
parameters (or at all), or null if not (denoted by the hooked function
returning false).
Peter-156 wrote:
in the function isValidPassWord the if condition on wfRunHooks is wrong,
at
least it seems a bit strange to me that your hook function should return
false for it to evaluate the $result parameter you return...
this is in the current trunk version of MediaWiki (1.12 alpha), possibly
in
earlier versions too...
anyway:
function isValidPassword( $password ) {
global $wgMinimalPasswordLength, $wgContLang;
$result = null;
if( !wfRunHooks( 'isValidPassword', array( $password, &$result,
$this ) ) )
return $result;
should be:
function isValidPassword( $password ) {
global $wgMinimalPasswordLength, $wgContLang;
$result = null;
if( !wfRunHooks( 'isValidPassword', array( $password, &$result,
$this ) ) )
return $result;
Cheers,
Peter.
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
http://lists.wikimedia.org/mailman/listinfo/wikitech-l
--
View this message in context:
http://www.nabble.com/small-bug-in-user.php-tf4497470.html#a12835468
Sent from the Wikipedia Developers mailing list archive at
Nabble.com.