From: Reedy Date: Fri, 21 Sep 2018 01:12:43 +0000 (+0100) Subject: Stop MailAddress accepting a User object X-Git-Tag: 1.34.0-rc.0~4033^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=d506c187ec4d33204ddbcbb3d370b5a86723dd49;hp=38b9d62b1ce046591d6835fd76e66318a8001a16 Stop MailAddress accepting a User object Bug: T204863 Change-Id: I98f110e47ec7ba3b1cd22e8d76eea4bdf7d3d155 --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index 51a149814c..16eec55058 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -312,6 +312,8 @@ because of Phabricator reports. * The global function wfUseMW, deprecated since 1.26, has now been removed. Use the "requires" property of static extension registration instead. * $wgSpecialPages no longer accepts array syntax, deprecated since 1.18. +* The MailAddress constructor can no longer be called with a User object, + behaviour which has been deprecated since 1.24. === Deprecations in 1.32 === * HTMLForm::setSubmitProgressive() is deprecated. No need to call it. Submit diff --git a/includes/mail/MailAddress.php b/includes/mail/MailAddress.php index 1b66c389b3..000bbe316b 100644 --- a/includes/mail/MailAddress.php +++ b/includes/mail/MailAddress.php @@ -46,22 +46,14 @@ class MailAddress { public $address; /** - * @param string $address String with an email address, or a User object + * @param string $address String with an email address * @param string|null $name Human-readable name if a string address is given * @param string|null $realName Human-readable real name if a string address is given */ function __construct( $address, $name = null, $realName = null ) { - if ( is_object( $address ) && $address instanceof User ) { - // Old calling format, now deprecated - wfDeprecated( __METHOD__ . ' with a User object', '1.24' ); - $this->address = $address->getEmail(); - $this->name = $address->getName(); - $this->realName = $address->getRealName(); - } else { - $this->address = strval( $address ); - $this->name = strval( $name ); - $this->realName = strval( $realName ); - } + $this->address = strval( $address ); + $this->name = strval( $name ); + $this->realName = strval( $realName ); } /**