File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,15 @@ public function setEmail(string $email): bool
4242 substr ($ email , -mb_strlen ("@gmail.com " )) == "@gmail.com " ||
4343 substr ($ email , -mb_strlen ("@googlemail.com " )) == "@googlemail.com "
4444 ) {
45- $ x = explode ("@ " , $ email , 2 );
45+ [ $ addr , $ host ] = explode ("@ " , $ email , 2 );
4646 // https://support.google.com/mail/thread/125577450/gmail-and-googlemail
47- if ($ x [ 1 ] == "googlemail.com " ) {
48- $ x [ 1 ] = "gmail.com " ;
47+ if ($ host == "googlemail.com " ) {
48+ $ host = "gmail.com " ;
4949 }
5050 // https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
51- $ x [ 0 ] = explode ("+ " , $ x [ 0 ] , 2 )[0 ];
52- $ x [ 0 ] = str_replace (". " , "" , $ x [ 0 ] );
53- $ email = implode ("@ " , $ x );
51+ $ addr = explode ("+ " , $ addr , 2 )[0 ];
52+ $ addr = str_replace (". " , "" , $ addr );
53+ $ email = implode ("@ " , [ trim ( $ addr ), trim ( $ host )] );
5454 }
5555
5656 $ this ->sha256_email_address = hash ("sha256 " , $ email );
You can’t perform that action at this time.
0 commit comments