diff options
author | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2011-10-23 07:55:45 +0000 |
---|---|---|
committer | Alexandre Emsenhuber <ialex@users.mediawiki.org> | 2011-10-23 07:55:45 +0000 |
commit | a9432cfd8b43d036c71b56da95d816f06c5862bd (patch) | |
tree | dd14148a57725330d1359564b8f6f94ebbae63b3 /includes/SkinTemplate.php | |
parent | 028f06bc9ca2c7efc199847313bc98f973fd08d2 (diff) | |
download | mediawikicore-a9432cfd8b43d036c71b56da95d816f06c5862bd.tar.gz mediawikicore-a9432cfd8b43d036c71b56da95d816f06c5862bd.zip |
Check first that $wgDisableLangConversion is false and we are not in a special page before doing the language variant check
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/100527
Diffstat (limited to 'includes/SkinTemplate.php')
-rw-r--r-- | includes/SkinTemplate.php | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 027db05e1475..56adcffbe55f 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1011,32 +1011,32 @@ class SkinTemplate extends Skin { array( &$this, &$content_navigation ) ); } - $pageLang = $title->getPageLanguage(); - - // Gets list of language variants - $variants = $pageLang->getVariants(); - // Checks that language conversion is enabled and variants exist - // And if it is not in the special namespace - if( !$wgDisableLangConversion && count( $variants ) > 1 - && $title->getNamespace() != NS_SPECIAL ) { - // Gets preferred variant (note that user preference is - // only possible for wiki content language variant) - $preferred = $pageLang->getPreferredVariant(); - // Loops over each variant - foreach( $variants as $code ) { - // Gets variant name from language code - $varname = $pageLang->getVariantname( $code ); - // Checks if the variant is marked as disabled - if( $varname == 'disable' ) { - // Skips this variant - continue; + if ( !$wgDisableLangConversion && $title->getNamespace() != NS_SPECIAL ) { + $pageLang = $title->getPageLanguage(); + // Gets list of language variants + $variants = $pageLang->getVariants(); + // Checks that language conversion is enabled and variants exist + // And if it is not in the special namespace + if( count( $variants ) > 1 ) { + // Gets preferred variant (note that user preference is + // only possible for wiki content language variant) + $preferred = $pageLang->getPreferredVariant(); + // Loops over each variant + foreach( $variants as $code ) { + // Gets variant name from language code + $varname = $pageLang->getVariantname( $code ); + // Checks if the variant is marked as disabled + if( $varname == 'disable' ) { + // Skips this variant + continue; + } + // Appends variant link + $content_navigation['variants'][] = array( + 'class' => ( $code == $preferred ) ? 'selected' : false, + 'text' => $varname, + 'href' => $title->getLocalURL( '', $code ) + ); } - // Appends variant link - $content_navigation['variants'][] = array( - 'class' => ( $code == $preferred ) ? 'selected' : false, - 'text' => $varname, - 'href' => $title->getLocalURL( '', $code ) - ); } } |