X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fskins%2FSkin.php;h=07964a4d5595619e5b748e4c7d83e29f20b1a815;hp=eaee0d257214de2ec9cd08714ac82ca50adfaa9d;hb=a8379682a46a428320c88702c800a6107c015137;hpb=f13ee14d2d488203989e432f48319ea2263f0b39 diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index eaee0d2572..07964a4d55 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -34,7 +34,11 @@ use MediaWiki\MediaWikiServices; * @ingroup Skins */ abstract class Skin extends ContextSource { + /** + * @var string|null + */ protected $skinname = null; + protected $mRelevantTitle = null; protected $mRelevantUser = null; @@ -134,7 +138,17 @@ abstract class Skin extends ContextSource { } /** - * @return string Skin name + * @since 1.31 + * @param string|null $skinname + */ + public function __construct( $skinname = null ) { + if ( is_string( $skinname ) ) { + $this->skinname = $skinname; + } + } + + /** + * @return string|null Skin name */ public function getSkinName() { return $this->skinname; @@ -1057,10 +1071,10 @@ abstract class Skin extends ContextSource { $targetUser = User::newFromId( $id ); } - # The sending user must have a confirmed email address and the target - # user must have a confirmed email address and allow emails from users. - return $this->getUser()->canSendEmail() && - $targetUser->canReceiveEmail(); + # The sending user must have a confirmed email address and the receiving + # user must accept emails from the sender. + return $this->getUser()->canSendEmail() + && SpecialEmailUser::validateTarget( $targetUser, $this->getUser() ) === ''; } /** @@ -1095,7 +1109,7 @@ abstract class Skin extends ContextSource { $title = Title::newMainPage(); self::checkTitle( $title, '' ); - return $title->getLocalURL( $urlaction ); + return $title->getLinkURL( $urlaction ); } /** @@ -1578,8 +1592,6 @@ abstract class Skin extends ContextSource { $attribs = []; if ( !is_null( $tooltip ) ) { - # T27462: undo double-escaping. - $tooltip = Sanitizer::decodeCharReferences( $tooltip ); $attribs['title'] = wfMessage( 'editsectionhint' )->rawParams( $tooltip ) ->inLanguage( $lang )->text(); }