Skip to:
Content

BuddyPress.org

Ticket #7024: 7024.02.patch

File 7024.02.patch, 3.1 KB (added by DJPaul, 4 years ago)
  • src/bp-core/bp-core-filters.php

    diff --git a/src/bp-core/bp-core-filters.php b/src/bp-core/bp-core-filters.php
    index e033972..ee21e41 100644
    a b function bp_core_menu_highlight_nav_menu_item( $retval, $item ) { 
    243243add_filter( 'nav_menu_css_class', 'bp_core_menu_highlight_nav_menu_item', 10, 2 );
    244244
    245245/**
     246 * Set "From" name in outgoing email to the site name.
     247 *
     248 * @since 1.0.0
     249 *
     250 * @return string The blog name for the root blog.
     251 */
     252function bp_core_email_from_name_filter() {
     253        _deprecated_function( __FUNCTION__, '2.5' );
     254
     255        /**
     256         * Filters the "From" name in outgoing email to the site name.
     257         *
     258         * @since 1.2.0
     259         *
     260         * @param string $value Value to set the "From" name to.
     261         */
     262        return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
     263}
     264add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
     265
     266/**
    246267 * Filter the blog post comments array and insert BuddyPress URLs for users.
    247268 *
    248269 * @since 1.2.0
  • src/bp-core/classes/class-bp-email.php

    diff --git a/src/bp-core/classes/class-bp-email.php b/src/bp-core/classes/class-bp-email.php
    index f4de900..3b50be9 100644
    a b class BP_Email { 
    171171                        $domain = 'localhost.localdomain';
    172172                }
    173173
    174                 // This was escaped with esc_html on the way into the database in sanitize_option().
    175                 $from_name    = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES );
    176                 $from_address = "wordpress@$domain";
    177 
    178174                /** This filter is documented in wp-includes/pluggable.php */
    179                 $from_address = apply_filters( 'wp_mail_from', $from_address );
     175                $from_address = apply_filters( 'wp_mail_from', "wordpress@$domain" );
    180176
     177                // This was escaped with esc_html on the way into the database in sanitize_option().
    181178                /** This filter is documented in wp-includes/pluggable.php */
    182                 $from_name = apply_filters( 'wp_mail_from_name', $from_name );
     179                $from_name = wp_specialchars_decode( apply_filters( 'wp_mail_from_name', 'WordPress' ), ENT_QUOTES );
    183180
    184181                $this->set_from( $from_address, $from_name );
    185182                $this->set_reply_to( bp_get_option( 'admin_email' ), $from_name );
  • src/bp-core/deprecated/2.5.php

    diff --git a/src/bp-core/deprecated/2.5.php b/src/bp-core/deprecated/2.5.php
    index 8656353..bcea2d2 100644
    a b  
    99defined( 'ABSPATH' ) || exit;
    1010
    1111/**
    12  * Set "From" name in outgoing email to the site name.
    13  *
    14  * @since 1.0.0
    15  * @deprecated 2.5.0 Not used. Was hooked to WordPress' "wp_mail_from_name" action.
    16  *                   Use the "bp_email_get_from" action instead.
    17  *
    18  * @return string The blog name for the root blog.
    19  */
    20 function bp_core_email_from_name_filter() {
    21         _deprecated_function( __FUNCTION__, '2.5' );
    22 
    23         /**
    24          * Filters the "From" name in outgoing email to the site name.
    25          *
    26          * @since 1.2.0
    27          * @deprecated 2.5.0 Not used.
    28          *
    29          * @param string $value Value to set the "From" name to.
    30          */
    31         return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
    32 }
    33 
    34 /**
    3512 * Add support for pre-2.5 email filters.
    3613 *
    3714 * @since 2.5.0