Open Bug 364111 Opened 18 years ago Updated 2 years ago

Don't allow colons in custom toolbar names

Categories

(Toolkit :: Toolbars and Toolbar Customization, defect)

defect

Tracking

()

People

(Reporter: philor, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

Because XUL hates us (bug 251273, bug 215489, bug 220701), we persist the currentset for customized toolbars as attributes on a toolbarset, so that if the toolbar named "foopy" has one element named "goats" on it, we persist |toolbar12345="foopy:goats"|, and then in the toolbar binding we recreate the toolbar with .split(":") and call [0] the name, and [1] the currentset.

That's fine until someone creates a toolbar named "foopy:goats", and then puts the perfectly legally named "<toolbarbutton id="foopy:goats">" button on it, when we'll persist |toolbar1234="foopy:goats:foopy:goats"| and then try to recreate a toolbar named "foopy" and put the element with id="goats" on it. If not for id="foopy:goats", we could .split(":"), pop(), join(":"), to call everything after the last colon the currentset, and everything before the name, but since we can't obscurely break perfectly legal XML, we need to tell the user "No! That's a bad, bad name."
Attached patch Fix v.1 (obsolete) — Splinter Review
Attachment #248897 - Flags: first-review?(gavin.sharp)
Status: NEW → ASSIGNED
Attachment #248897 - Flags: first-review?(gavin.sharp) → review?(gavin.sharp)
Gavin: do you remember anything we said, when we talked about this in Decemberish? I vaguely remember "the horror, the horror" and not having the feeling that it would be cheap to migrate to something nicer, but that's about it.
I don't remember anything specific other than the general ickiness I still feel now as I read the patch. Can we just silently strip out colons?
Attached patch Fix v.2Splinter Review
Sure, silently stripping them is much easier. I'll get around to looking at how to testcase this, erm, sometime.
Attachment #248897 - Attachment is obsolete: true
Attachment #248897 - Flags: review?(gavin.sharp)
Though I notice looking at it now, that our behavior when you have an existing toolbar named Foobar, and you try to create Foo:bar, would be exactly the sort of thing that reasonably enrages users.
Assignee: philringnalda → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: