Closed Bug 1904909 Opened 3 months ago Closed 3 months ago

PlacesUtils::GatherDataText and GatherDataHtml should not recurse into queries

Categories

(Toolkit :: Places, task, P3)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file)

GatherDataText and GatherDataHTML recurse into containers to build a string representation of a node, with the scope of being able to paste or drop a list of URIs into a receiver app/field.
There is no protection against building a too large string or recursing too much here.
I think at first stance we could allow recursion only for real folders, as you can't build infinite structures with folders. That will limit a bit the reach of the feature, but one can still copy the first level of a query or a tag. And when one is copying a root shortcut, we'll allow to recurse into folders, but not into other queries or shortcuts.
One can always export bookmarks as json or html anyway when they need a full tree.

Assignee: nobody → mak
Status: NEW → ASSIGNED

There's a few problems in the code gathering text data for nodes.
First it should not recurse into queries (included folder shortcuts) as it's
easy to create infinite recursion with them. The first level is excluded though,
as otherwise it would not be possible to copy contents of left pane roots.
Second it should requery folder shortcut contents in excludeItems results,
as otherwise it's not possible to copy contents of a root as text.
There's no longer the risk of dragging around root folders as this code is only
used for text flavors today, drag&drop uses serializeNode instead.

Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/5fa13edbcc74 PlacesUtils::GatherDataText and GatherDataHtml should not recurse into queries r=daisuke,places-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: