From 48c0dbc7a3277a015671842f6c77d15a6af6bbd1 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Sun, 13 Dec 2015 03:42:00 -0500 Subject: [PATCH] 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 --- includes/Linker.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.20.1