From 5ce1e2b743d54aad84971215a2290aab7f661440 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 19 Apr 2019 14:49:40 -0700 Subject: [PATCH] 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 --- includes/Linker.php | 7 +++++-- tests/phpunit/includes/logging/LogFormatterTest.php | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) 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, [], [] ); -- 2.20.1