fix(35): WR-03 treat data: in a site name as a data URL only with ; or ,
scriptURLText took data: followed by any non-space character as a data URL, so names such as Data:Lab, Big Data:Summit and data:Science were refused on the Branding form and dropped from mail, contrary to the docs. A data URL now needs its optional MIME type and the ; or , every data URL has. javascript: and vbscript: keep matching with whitespace after the colon, since such a URL still runs.
This commit is contained in:
@@ -87,7 +87,7 @@ func TestMailSiteNameSafety(t *testing.T) {
|
||||
t.Run("prose_names_saved", func(t *testing.T) {
|
||||
// Text shaped like an event handler is text, also after the footer's
|
||||
// "© <year> " (CR-01 residual, WR-02).
|
||||
for _, name := range []string{"Big Data: Summit", "Metadata: Weekly", "Online=Shop", "onboarding=team"} {
|
||||
for _, name := range []string{"Big Data: Summit", "Metadata: Weekly", "Online=Shop", "onboarding=team", "Data:Lab", "Big Data:Summit"} {
|
||||
saved := env.expect(t, http.StatusOK, http.MethodPut, mailBrandPath, root, map[string]any{"site_name": name})
|
||||
if got := dataOf(saved)["data"].(map[string]any)["site_name"]; got != name {
|
||||
t.Errorf("response site_name = %#v, want %q", got, name)
|
||||
|
||||
Reference in New Issue
Block a user