Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-25 05:40:29 +01:00
Fix backwards indices
Dieser Commit ist enthalten in:
Ursprung
ebb36235a7
Commit
f5916ec396
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
|
@ -273,8 +273,8 @@ impl EmailTokenData {
|
||||||
pub fn obscure_email(email: &str) -> String {
|
pub fn obscure_email(email: &str) -> String {
|
||||||
let split: Vec<&str> = email.rsplitn(2, '@').collect();
|
let split: Vec<&str> = email.rsplitn(2, '@').collect();
|
||||||
|
|
||||||
let mut name = split[0].to_string();
|
let mut name = split[1].to_string();
|
||||||
let domain = &split[1];
|
let domain = &split[0];
|
||||||
|
|
||||||
let name_size = name.chars().count();
|
let name_size = name.chars().count();
|
||||||
|
|
||||||
|
|
|
@ -264,12 +264,12 @@ fn send_email(address: &str, subject: &str, body_html: &str, body_text: &str) ->
|
||||||
err!("Invalid email address (no @)");
|
err!("Invalid email address (no @)");
|
||||||
}
|
}
|
||||||
|
|
||||||
let domain_puny = match idna::domain_to_ascii_strict(address_split[1]) {
|
let domain_puny = match idna::domain_to_ascii_strict(address_split[0]) {
|
||||||
Ok(d) => d,
|
Ok(d) => d,
|
||||||
Err(_) => err!("Can't convert email domain to ASCII representation"),
|
Err(_) => err!("Can't convert email domain to ASCII representation"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let address = format!("{}@{}", address_split[0], domain_puny);
|
let address = format!("{}@{}", address_split[1], domain_puny);
|
||||||
|
|
||||||
let html = PartBuilder::new()
|
let html = PartBuilder::new()
|
||||||
.body(encode_to_str(body_html))
|
.body(encode_to_str(body_html))
|
||||||
|
|
Laden …
In neuem Issue referenzieren