Skip to:
Content

BuddyPress.org

Ticket #8003: 8003.disable-user-lookup.patch

File 8003.disable-user-lookup.patch, 2.0 KB (added by r-a-y, 6 years ago)
  • src/bp-core/classes/class-bp-email-recipient.php

     
    5151         * @param string|array|int|WP_User $email_or_user Either a email address, user ID, WP_User object,
    5252         *                                                or an array containing any combination of the above.
    5353         * @param string $name Optional. If $email_or_user is a string, this is the recipient's name.
     54         * @param bool $lookup_name Optional. If $email_or_user is an email address, look up the email address
     55         *                          in WordPress to find the user's name. Default: true.
    5456         */
    55         public function __construct( $email_or_user, $name = '' ) {
     57        public function __construct( $email_or_user, $name = '', $lookup_name = true ) {
    5658                $name = sanitize_text_field( $name );
    5759
    5860                // User ID, email address or WP_User object.
     
    9294                }
    9395
    9496                // Still no user object; try to query user by email address.
    95                 if ( empty( $this->user_object ) ) {
     97                if ( empty( $this->user_object ) && true === $lookup_name ) {
    9698                        $this->get_user( 'search-email' );
    9799                }
    98100
  • src/bp-core/classes/class-bp-email.php

     
    738738         * @return BP_Email
    739739         */
    740740        public function set_from( $email_address, $name = '' ) {
    741                 $from = new BP_Email_Recipient( $email_address, $name );
     741                $from = new BP_Email_Recipient( $email_address, $name, false );
    742742
    743743                /**
    744744                 * Filters the new value of the email's "from" property.
     
    810810         * @return BP_Email
    811811         */
    812812        public function set_reply_to( $email_address, $name = '' ) {
    813                 $reply_to = new BP_Email_Recipient( $email_address, $name );
     813                $reply_to = new BP_Email_Recipient( $email_address, $name, false );
    814814
    815815                /**
    816816                 * Filters the new value of the email's "reply to" property.