Making WordPress.org


Ignore:
Timestamp:
08/15/2023 02:12:34 AM (3 years ago)
Author:
dd32
Message:

HelpScout: If an email comes from 'example+auto-reply@' try looking for 'example@' if the former didn't match.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r12757 r12842  
    247247                if ( $user ) {
    248248                        return $user;
     249                }
     250
     251                // If the email is a plus address, try without. This is common with auto-responders it seems.
     252                if ( str_contains( $maybe_email, '+' ) ) {
     253                        $maybe_email = preg_replace( '/[+].+@/', '@', $maybe_email );
     254                        $user        = get_user_by( 'email', $maybe_email );
     255                        if ( $user ) {
     256                                return $user;
     257                        }
    249258                }
    250259        }
Note: See TracChangeset for help on using the changeset viewer.