MediaWiki master
LanguageConverterSpecific.php
Go to the documentation of this file.
1<?php
22
28abstract class LanguageConverterSpecific extends LanguageConverter {
39 public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
40 // check for user namespace
41 if ( is_object( $nt ) ) {
42 $ns = $nt->getNamespace();
43 if ( $ns === NS_USER || $ns === NS_USER_TALK ) {
44 return;
45 }
46 }
47
48 $oldlink = $link;
49 parent::findVariantLink( $link, $nt, $ignoreOtherCond );
50 if ( $this->getPreferredVariant() == $this->getMainCode() ) {
51 $link = $oldlink;
52 }
53 }
54}
const NS_USER
Definition Defines.php:67
const NS_USER_TALK
Definition Defines.php:68
A class that extends LanguageConverter with specific behaviour.
findVariantLink(&$link, &$nt, $ignoreOtherCond=false)
A function wrapper:
Represents a title within MediaWiki.
Definition Title.php:78