From: Domas Mituzas Date: Wed, 5 Apr 2006 09:16:28 +0000 (+0000) Subject: Fix chaining of UserCan extension return results X-Git-Tag: 1.6.0~5 X-Git-Url: http://git.cyclocoop.org/%22%20%20.%20generer_url_ecrire%28%22mots_tous%22%29%20.%20%22?a=commitdiff_plain;h=7c48fefa3f4d0568ddc699cff1a7cec4f232adc8;p=lhc%2Fweb%2Fwiklou.git Fix chaining of UserCan extension return results --- diff --git a/includes/Title.php b/includes/Title.php index 0408f51409..ba1539e7cc 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -966,12 +966,11 @@ class Title { global $wgUser; - $result = true; - if ( !wfRunHooks( 'userCan', array( &$this, &$wgUser, $action, &$result ) ) ) { + $result = null; + wfRunHooks( 'userCan', array( &$this, &$wgUser, $action, &$result ) ); + if ( $result !== null ) { wfProfileOut( $fname ); - // Allow advisory rights checking - if ( $result !== null ) - return $result; + return $result; } if( NS_SPECIAL == $this->mNamespace ) { @@ -1077,8 +1076,8 @@ class Title { function userCanRead() { global $wgUser; - $result = true; - if ( !wfRunHooks( 'userCan', array( &$this, &$wgUser, "read", &$result ) ) ) { + wfRunHooks( 'userCan', array( &$this, &$wgUser, 'read', &$result ) ); + if ( $result !== null ) { return $result; }