}
}
+ // Strip off subpages
+ $pagename = $this->getText();
+ if ( strpos( $pagename, '/' ) !== false ) {
+ list( $username , ) = explode( '/', $pagename, 2 );
+ } else {
+ $username = $pagename;
+ }
+
if ( $wgContLang->needsGenderDistinction() &&
MWNamespace::hasGenderDistinction( $this->mNamespace ) ) {
- $gender = GenderCache::singleton()->getGenderOf( $this->getText(), __METHOD__ );
+ $gender = GenderCache::singleton()->getGenderOf( $username, __METHOD__ );
return $wgContLang->getGenderNsText( $this->mNamespace, $gender );
}