[Bps-public-commit] RT-Extension-MergeUsers branch master updated. 1.08-1-gcb4f0cb

BPS Git Server git at git.bestpractical.com
Mon Jul 31 20:21:09 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "RT-Extension-MergeUsers".

The branch, master has been updated
       via  cb4f0cb8aa907e5d487f6fb5639f8924ff41a839 (commit)
      from  68654424571c4629693c6b72f368b6b5fa9de73e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cb4f0cb8aa907e5d487f6fb5639f8924ff41a839
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jul 31 12:51:32 2023 -0400

    Do not try to load user from an empty email address
    
    It's possible that DB finds a user record that doesn't have email
    address. If the user was merged into another record that does have email
    address, this unrelated email address would be returned as the canonical
    value of empty email, which wrongly prevented RT from creating users
    with empty emails.

diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index c1a9660..9002cdd 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -195,6 +195,9 @@ sub CanonicalizeEmailAddress {
         $address =~ s/$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
     }
 
+    # Empty emails should not be used to find users
+    return $address unless defined $address && length $address;
+
     # get the user whose email address this is
     my $canonical_user = RT::User->new( $RT::SystemUser );
     $canonical_user->LoadByCols( EmailAddress => $address );

-----------------------------------------------------------------------

Summary of changes:
 lib/RT/Extension/MergeUsers.pm | 3 +++
 1 file changed, 3 insertions(+)


hooks/post-receive
-- 
RT-Extension-MergeUsers


More information about the Bps-public-commit mailing list