From e9051e2d3f2291e6248aebf1335b554fbee3e166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 6 Feb 2018 17:39:01 +0100 Subject: [PATCH] Don't apply CLL to pages with the noexternallanglinks magic word There is actually a magic word and a parser function. This checks if all links are excluded (*). Bug: T186590 Change-Id: Iaf860683f6e3bc9b00d5e8f19b8be7c0f1b20f5b --- UniversalLanguageSelector.hooks.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 3dc19ad9..367dadaa 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -119,7 +119,10 @@ class UniversalLanguageSelectorHooks { // If the extension is enabled, basic features (API, language data) available. $out->addModules( 'ext.uls.init' ); - if ( self::isCompactLinksEnabled( $out->getUser() ) ) { + // Soft dependency to Wikibase client. Don't enable CLL if links are managed manually. + $excludedLinks = $out->getProperty( 'noexternallanglinks' ); + $override = is_array( $excludedLinks ) && in_array( '*', $excludedLinks ); + if ( !$override && self::isCompactLinksEnabled( $out->getUser() ) ) { $out->addModules( 'ext.uls.compactlinks' ); }