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
This commit is contained in:
Niklas Laxström
2018-02-06 17:39:01 +01:00
parent 0c2c273c93
commit e9051e2d3f

View File

@@ -119,7 +119,10 @@ class UniversalLanguageSelectorHooks {
// If the extension is enabled, basic features (API, language data) available. // If the extension is enabled, basic features (API, language data) available.
$out->addModules( 'ext.uls.init' ); $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' ); $out->addModules( 'ext.uls.compactlinks' );
} }