Split down patch-actor-table.sql
[lhc/web/wiklou.git] / includes / mail / MailAddress.php
index 7a228bd..b9d9414 100644 (file)
  * header format when requested.
  */
 class MailAddress {
+       /**
+        * @var string
+        */
+       public $name;
+
+       /**
+        * @var string
+        */
+       public $realName;
+
+       /**
+        * @var string
+        */
+       public $address;
+
        /**
         * @param string $address String with an email address, or a User object
         * @param string $name Human-readable name if a string address is given
@@ -73,8 +88,9 @@ class MailAddress {
                                global $wgEnotifUseRealName;
                                $name = ( $wgEnotifUseRealName && $this->realName !== '' ) ? $this->realName : $this->name;
                                $quoted = UserMailer::quotedPrintable( $name );
-                               if ( strpos( $quoted, '.' ) !== false || strpos( $quoted, ',' ) !== false ) {
-                                       $quoted = '"' . $quoted . '"';
+                               // Must only be quoted if string does not use =? encoding (T191931)
+                               if ( $quoted === $name ) {
+                                       $quoted = '"' . addslashes( $quoted ) . '"';
                                }
                                return "$quoted <{$this->address}>";
                        } else {