Hygiene: remove deprecated calls from Menu system

Changes:
 - Title::getTalkPage() is deprecated, use NamespaceInfo instead
 - Http::isValidURI is deprecated, use MWHttpRequest instead

Change-Id: I6938fe93d18372ef855f398a506c8b5ba68b640e
This commit is contained in:
Piotr Miazga 2019-08-02 16:49:11 +02:00
parent d8de612e0c
commit 3b13e6b9f6
2 changed files with 13 additions and 10 deletions

View file

@ -30,6 +30,7 @@ use MediaWiki\Minerva\Menu\Entries\SingleMenuEntry;
use Message;
use MinervaUI;
use MWException;
use MWHttpRequest;
use SpecialMobileWatchlist;
use SpecialPage;
use Title;
@ -302,7 +303,7 @@ final class Definitions {
}
$inContentLang = $message->inContentLanguage();
$titleName = $inContentLang->plain();
if ( $inContentLang->isDisabled() || \Http::isValidURI( $titleName ) ) {
if ( $inContentLang->isDisabled() || MWHttpRequest::isValidURI( $titleName ) ) {
return;
}
$title = Title::newFromText( $titleName );

View file

@ -68,15 +68,17 @@ final class AdvancedUserMenuBuilder implements IUserMenuBuilder {
public function getGroup( array $personalTools ): Group {
$group = new Group();
$group->insertEntry( new ProfileMenuEntry( $this->user ) );
$group->insertEntry( new SingleMenuEntry(
'userTalk',
$this->messageLocalizer->msg( 'mobile-frontend-user-page-talk' )->escaped(),
$this->user->getUserPage()->getTalkPage()->getLocalURL(),
true,
null,
'before',
'wikimedia-ui-userTalk-base20'
) );
$talkPage = $this->user->getUserPage()->getTalkPageIfDefined();
if ( $talkPage ) {
$group->insertEntry( new SingleMenuEntry( 'userTalk',
$this->messageLocalizer->msg( 'mobile-frontend-user-page-talk' )->escaped(),
$talkPage->getLocalURL(),
true,
null,
'before',
'wikimedia-ui-userTalk-base20'
) );
}
$sandbox = $personalTools['sandbox']['links'][0] ?? false;
if ( $sandbox ) {