From: Brian Wolff Date: Sun, 13 Dec 2015 08:42:00 +0000 (-0500) Subject: Make redlink tooltip be content language to stop cache pollution. X-Git-Tag: 1.31.0-rc.0~8277^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=48c0dbc7a3277a015671842f6c77d15a6af6bbd1;p=lhc%2Fweb%2Fwiklou.git Make redlink tooltip be content language to stop cache pollution. Redlink tooltips end up in parser cache! This is not ideal, as ideally it would be in the page's language, not the content language and it would be user language for things outside of pages, but that's not easy to do the way the code is structured, and this is much better than the alternative. Other possibilities include: * Splitting parser cache (Previously been reverted, and doesn't seem worth it given the feature in question) * Post-processing step after parsing (Really complicated. Doesn't seem worth it) Bug: T34686 Change-Id: Id632f8ef59d1c762aed1867a708c569cbff5f0dd --- diff --git a/includes/Linker.php b/includes/Linker.php index 0dd4c478fe..3ba472bad2 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -346,7 +346,10 @@ class Linker { } elseif ( in_array( 'known', $options ) ) { $defaults['title'] = $target->getPrefixedText(); } else { - $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() )->text(); + // This ends up in parser cache! + $defaults['title'] = wfMessage( 'red-link-title', $target->getPrefixedText() ) + ->inContentLanguage() + ->text(); } # Finally, merge the custom attribs with the default ones, and iterate