If a wiki sysadmin allowed to change the page language using the Special:PageLanguage special page (set $wgPageLanguageUseDB (added in T37489) to true), and someone changes the language of a page to en (e.g.) from de (e.g.), the special page Special:MyLanguage doesn't work as expected anymore. Consider the following example:
The UI language and the main content language of a wiki is german (de), but some pages are in english and translateable via the Translate extension (e.g. if the wiki translates the pages from another language to the main wiki language), this will work without any problems once T121666: DBPageLanguage isn't returned by Title::getPageLanguage is fixed. So the UI language is still de, but the content language for this particular page(s) is en.
Now, the page is translated and a /de subpage holds the translated content for the english page. Linking from another page would normally go through Special:MyLanguage to get the correct language version for this page, e.g. "Special:MyLanguage/Testpage". If a user clicks this link now (while the UI language is still german), the expected target would be "Testpage/de", but the user will be redirected to "Testpage" (the english version).
The problem seems to be, that Special:MyLanguage checks, if the current language of the user is the main content language of the site ($wgLanguageCode) and, if this is true, redirects to the page without any language code. This works very well for "normal" pages, but is a bad idea, if the page language was changed to another one (another as wgLanguageCode):
$uiCode = $this->getLanguage()->getCode(); $proposed = $base->getSubpage( $uiCode ); if ( $uiCode !== $this->getConfig()->get( 'LanguageCode' ) && $proposed && $proposed->exists() ) { return $proposed; } elseif ( $provided && $provided->exists() ) { return $provided; } else { return $base; }