* Follow-up r96420: don't show e-mail links to anon users
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 11 Sep 2011 08:14:46 +0000 (08:14 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 11 Sep 2011 08:14:46 +0000 (08:14 +0000)
* Fix for r24612 (!) spotted while fixing the above: parenthesis arround the bitwise check are needed since ! operator has higher precedence than &

includes/Linker.php

index 3297e97..837def2 100644 (file)
@@ -941,8 +941,8 @@ class Linker {
        ) {
                global $wgUser, $wgDisableAnonTalk, $wgLang;
                $talkable = !( $wgDisableAnonTalk && 0 == $userId );
-               $blockable = !$flags & self::TOOL_LINKS_NOBLOCK;
-               $addEmailLink = $flags & self::TOOL_LINKS_EMAIL;
+               $blockable = !( $flags & self::TOOL_LINKS_NOBLOCK );
+               $addEmailLink = $flags & self::TOOL_LINKS_EMAIL && $userId;
 
                $items = array();
                if ( $talkable ) {