Stop MailAddress accepting a User object
authorReedy <reedy@wikimedia.org>
Fri, 21 Sep 2018 01:12:43 +0000 (02:12 +0100)
committerJforrester <jforrester@wikimedia.org>
Fri, 21 Sep 2018 01:58:03 +0000 (01:58 +0000)
Bug: T204863
Change-Id: I98f110e47ec7ba3b1cd22e8d76eea4bdf7d3d155

RELEASE-NOTES-1.32
includes/mail/MailAddress.php

index 51a1498..16eec55 100644 (file)
@@ -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
index 1b66c38..000bbe3 100644 (file)
@@ -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 );
        }
 
        /**