87 $base = $provided =
null;
88 if ( $subpage !==
null ) {
89 $provided = Title::newFromText( $subpage );
92 if ( $provided && strpos( $subpage,
'/' ) !==
false ) {
93 $pos = strrpos( $subpage,
'/' );
94 $basepage = substr( $subpage, 0, $pos );
95 $code = substr( $subpage, $pos + 1 );
96 if ( strlen( $code ) && $this->languageNameUtils->isKnownLanguageTag( $code ) ) {
97 $base = Title::newFromText( $basepage );
107 if (
$base->isRedirect() ) {
108 $page = $this->wikiPageFactory->newFromTitle(
$base );
109 $base = $page->getRedirectTarget();
115 if ( $uiLang->equals( $contLang ) ) {
122 $proposed =
$base->getSubpage( $uiLang->getCode() );
123 if ( $proposed && $proposed->exists() ) {
127 if ( $provided !==
$base && $provided->exists() ) {
133 $possibilities = $uiLang->getFallbackLanguages();
134 foreach ( $possibilities as
$lang ) {
135 if (
$lang !== $contLang->getCode() ) {
137 if ( $proposed && $proposed->exists() ) {