Closed Bug 321180 Opened 19 years ago Closed 16 years ago

nsXULTemplateBuilder::CompileQueries string parsing is weak

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta1

People

(Reporter: enndeakin, Assigned: enndeakin)

References

Details

Attachments

(1 file)

The parsing of the flags attribute is weak.

    if (flags.Find(NS_LITERAL_STRING("dont-test-empty")) >= 0)
        mFlags |= eDontTestEmpty;

It doesn't look for surrounding whitespace for example.
Target Milestone: Future → mozilla1.9beta2
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
Attachment #350956 - Flags: superreview?(jonas)
Attachment #350956 - Flags: review?(jonas)
Attachment #350956 - Flags: superreview?(jonas)
Attachment #350956 - Flags: superreview+
Attachment #350956 - Flags: review?(jonas)
Attachment #350956 - Flags: review+
Comment on attachment 350956 [details] [diff] [review]
better space-separated handling for flags and sort keys

>+    // see if they are empty. If dont-recurse is set, then don't process the
>+    // template recursively and only show one level of results.
>+    nsWhitespaceTokenizer tokenizer(flags);
>+    while (tokenizer.hasMoreTokens()) {
>+      nsAutoString token(tokenizer.nextToken());

This will end up copying. You can avoid it by using nsDependentSubstring instead.

r/sr=me with that
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: