Linker: Use parentheses by default in userToolLinksRedContribs()
authorRoan Kattouw <roan.kattouw@gmail.com>
Fri, 19 Apr 2019 21:49:40 +0000 (14:49 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Fri, 19 Apr 2019 22:09:36 +0000 (15:09 -0700)
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
tests/phpunit/includes/logging/LogFormatterTest.php

index d2936a9..9cca0be 100644 (file)
@@ -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 );
        }
 
        /**
index 91ce9ea..f444d40 100644 (file)
@@ -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, [], [] );