From: Kunal Mehta Date: Thu, 19 May 2016 21:42:52 +0000 (-0700) Subject: Remove 'noclasses' from Linker::linkKnown() defaults X-Git-Tag: 1.31.0-rc.0~6850^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=c66b6a1e437185d5ad8410f27c7df680d3433fd0;p=lhc%2Fweb%2Fwiklou.git Remove 'noclasses' from Linker::linkKnown() defaults The intention for Linker::linkKnown() was to be used when the caller had already preloaded the target's existence ('known') and called Linker::getLinkColour() directly ('noclasses'). However, nearly all usage of linkKnown() only did the first part, and not the latter. So do what people actually ended up using the function for, and remove 'noclasses' from the default parameters. As long as the target the link is being created for is already in LinkCache, this shouldn't cause any extra database queries. Change-Id: Ia5a4c2f18ec780627146617a1498bd04fcfbb3ee --- diff --git a/includes/DummyLinker.php b/includes/DummyLinker.php index 6545c4aac5..d9330eebc2 100644 --- a/includes/DummyLinker.php +++ b/includes/DummyLinker.php @@ -72,7 +72,7 @@ class DummyLinker { $html = null, $customAttribs = [], $query = [], - $options = [ 'known', 'noclasses' ] + $options = [ 'known' ] ) { return Linker::linkKnown( $target, diff --git a/includes/Linker.php b/includes/Linker.php index 6a869dd45f..20dc9b264a 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -269,7 +269,7 @@ class Linker { */ public static function linkKnown( $target, $html = null, $customAttribs = [], - $query = [], $options = [ 'known', 'noclasses' ] + $query = [], $options = [ 'known' ] ) { return self::link( $target, $html, $customAttribs, $query, $options ); } diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 7051b4f5b0..930c87923a 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -13944,7 +13944,7 @@ Redirected image !! wikitext [[Image:Barfoo.jpg]] !! html/php -

File:Barfoo.jpg +

File:Barfoo.jpg

!! end