Skip to:
Content

bbPress.org

Changeset 5639


Ignore:
Timestamp:
03/17/2015 12:26:37 AM (6 years ago)
Author:
netweb
Message:

Use preg_replace over incorrect ltrim usage in bbp_get_do_not_reply_address() causing undeliverable or invalid subscription emails in certain situations because the "from" address was incorrect.

Props DJPaul. See #2618 (2.5 Branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/common/functions.php

    r5259 r5639  
    993993 * those cases, we recommend unhooking this function and creating your own
    994994 * custom emailer script.
    995  * 
     995 *
    996996 * @since bbPress (r2668)
    997997 *
     
    10631063    $reply_url     = bbp_get_reply_url( $reply_id );
    10641064    $blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    1065     $do_not_reply  = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';
     1065    $do_not_reply  = '<noreply@' . preg_replace( '@^https?://(www\.)?@i', '', get_home_url() ) . '>';
    10661066
    10671067    // For plugins to filter messages per reply/topic/user
     
    11011101    // Setup the From header
    11021102    $headers[] = 'From: ' . get_bloginfo( 'name' ) . ' ' . $do_not_reply;
    1103    
     1103
    11041104    // Get topic subscribers and bail if empty
    11051105    $user_ids = bbp_get_topic_subscribers( $topic_id, true );
     
    11461146 * those cases, we recommend unhooking this function and creating your own
    11471147 * custom emailer script.
    1148  * 
     1148 *
    11491149 * @since bbPress (r5156)
    11501150 *
     
    12031203    $topic_url     = get_permalink( $topic_id );
    12041204    $blog_name     = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    1205     $do_not_reply  = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';
     1205    $do_not_reply  = '<noreply@' . preg_replace( '@^https?://(www\.)?@i', '', get_home_url() ) . '>';
    12061206
    12071207    // For plugins to filter messages per reply/topic/user
     
    12411241    // Setup the From header
    12421242    $headers[] = 'From: ' . get_bloginfo( 'name' ) . ' ' . $do_not_reply;
    1243    
     1243
    12441244    // Get topic subscribers and bail if empty
    12451245    $user_ids = bbp_get_forum_subscribers( $forum_id, true );
Note: See TracChangeset for help on using the changeset viewer.