| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
localized_short_name = base::CollapseWhitespace(localized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&localized_short_name);
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}Thoughts on a catch all so that `display_name_` can get the same sanitization, for consistency?
```suggestion
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}
// Now that short_name_ is populated from either branch, sanitize it.
std::u16string sanitized_short_name = base::UTF8ToUTF16(short_name_);
sanitized_short_name = base::CollapseWhitespace(sanitized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&sanitized_short_name);
base::i18n::AdjustStringForLocaleDirection(&sanitized_short_name);
short_name_ = base::UTF16ToUTF8(sanitized_short_name);
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
localized_short_name = base::CollapseWhitespace(localized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&localized_short_name);
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}Thoughts on a catch all so that `display_name_` can get the same sanitization, for consistency?
```suggestion
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}// Now that short_name_ is populated from either branch, sanitize it.
std::u16string sanitized_short_name = base::UTF8ToUTF16(short_name_);
sanitized_short_name = base::CollapseWhitespace(sanitized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&sanitized_short_name);
base::i18n::AdjustStringForLocaleDirection(&sanitized_short_name);
short_name_ = base::UTF16ToUTF8(sanitized_short_name);```
I don't think that's necessary. `display_name_` is already sanitized by `LoadName`, so the else branch is safe as-is.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
localized_short_name = base::CollapseWhitespace(localized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&localized_short_name);
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}Andrea OrruThoughts on a catch all so that `display_name_` can get the same sanitization, for consistency?
```suggestion
base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
short_name_ = base::UTF16ToUTF8(localized_short_name);
} else {
short_name_ = display_name_;
}// Now that short_name_ is populated from either branch, sanitize it.
std::u16string sanitized_short_name = base::UTF8ToUTF16(short_name_);
sanitized_short_name = base::CollapseWhitespace(sanitized_short_name, true);
base::i18n::SanitizeUserSuppliedString(&sanitized_short_name);
base::i18n::AdjustStringForLocaleDirection(&sanitized_short_name);
short_name_ = base::UTF16ToUTF8(sanitized_short_name);```
I don't think that's necessary. `display_name_` is already sanitized by `LoadName`, so the else branch is safe as-is.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |