From: Roan Kattouw Date: Fri, 19 Apr 2019 21:49:40 +0000 (-0700) Subject: Linker: Use parentheses by default in userToolLinksRedContribs() X-Git-Tag: 1.34.0-rc.0~1885^2~1 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=5ce1e2b743d54aad84971215a2290aab7f661440;p=lhc%2Fweb%2Fwiklou.git Linker: Use parentheses by default in userToolLinksRedContribs() This function had been changed to unconditionally disable parentheses, but none of its callers load the CSS needed to make that work. Bug: T220767 Change-Id: I566d65e155258d3bd1a1a06bca9aa2b3a2d417ee Follows-Up: I6eeeaa3b58d37adb7fefb4cc6915022229b3b324 --- diff --git a/includes/Linker.php b/includes/Linker.php index d2936a99ed..9cca0be9d3 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1002,10 +1002,13 @@ class Linker { * @param int $userId User identifier * @param string $userText User name or IP address * @param int|null $edits User edit count (optional, for performance) + * @param bool $useParentheses (optional) Wrap comments in parentheses where needed * @return string */ - public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) { - return self::userToolLinks( $userId, $userText, true, 0, $edits, false ); + public static function userToolLinksRedContribs( + $userId, $userText, $edits = null, $useParentheses = true + ) { + return self::userToolLinks( $userId, $userText, true, 0, $edits, $useParentheses ); } /** diff --git a/tests/phpunit/includes/logging/LogFormatterTest.php b/tests/phpunit/includes/logging/LogFormatterTest.php index 91ce9ea6c8..f444d40c3e 100644 --- a/tests/phpunit/includes/logging/LogFormatterTest.php +++ b/tests/phpunit/includes/logging/LogFormatterTest.php @@ -105,7 +105,8 @@ class LogFormatterTest extends MediaWikiLangTestCase { $userTools = Linker::userToolLinksRedContribs( $this->user->getId(), $this->user->getName(), - $this->user->getEditCount() + $this->user->getEditCount(), + false ); $titleLink = Linker::link( $this->title, null, [], [] );