Closed Bug 42009 Opened 25 years ago Closed 24 years ago

DnD url to Windows desktop should ensure a valid filename

Categories

(Core :: XUL, defect, P3)

x86
Windows NT
defect

Tracking

()

RESOLVED DUPLICATE of bug 78509
mozilla0.9.9

People

(Reporter: Chris244, Assigned: mikepinkerton)

References

Details

(Keywords: helpwanted, Whiteboard: [nsbeta3-])

Attachments

(1 file)

The title of a document is used as the filename when dragging from the browser (link proxy icon for example) to the Windows desktop. The title may not be a valid filename, so it should be converted to one before passing it as a filename. In particular: < > : " / \ | and any control characters (< 32) should be converted to a safe character like space or deleted. Another thing to consider is if the filename is the same as a system device like aux, con, prn, etc.
assigning to pinkerton, nominating for nsbeta2
Assignee: trudelle → pinkerton
Keywords: nsbeta2
anticipating nsbeta2+
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → M18
Thought we were not doing Dnd to desktop...trudelle?
Whiteboard: [NEED INFO]
That feature (bug 37410) was granted nsbeta2+ [6/22] status at a PDT triage session I attended 10 days ago. We had a fix from an external contributor, but found equivalent code elsewhere in mozilla that had already been tested. I'd expect that we already have code that flags invalid file names to fix this bug, too.
this is dependent on 41985, which probably won't be fixed until beta3. nominating for beta3.
Depends on: 41985
Keywords: nsbeta2nsbeta3
Whiteboard: [NEED INFO]
Target Milestone: M18 → M21
Whiteboard: nsbeta3+
Whiteboard: nsbeta3+ → [nsbeta3+]
pushing out, marking helpwanted.
Keywords: helpwanted
Whiteboard: [nsbeta3+] → [nsbeta3-]
Target Milestone: M21 → Future
I'm in! (After being the best man at a wedding in Vegas next Tuesday, of course)
*** Bug 51046 has been marked as a duplicate of this bug. ***
I expect this is pretty easy so perhaps Dean and I can work out a fix when I get back (Tuesday)
Japanese SJIS(shift jis) multibyte-character ranges 0x0020-0x00ff,0x8140-0xfcff, so please be careful not to use simple method like 's/\\/./g'.
Target Milestone: Future → mozilla1.0
Blake, I can't recall us ever looking at this. Whenever you're up for it, let me know.
If we remove ':', I think we'll remove the possibility of coming up with a valid device name, as most end with a colon (eg. "lpt1:"). I can do this, but I want to make sure that I've got all characters considered. The original bug is to change < > : " / \ | any character < 32. I'm not sure what to make of the Japanese SJIS comment from takagix, though.
Here's an initial implementation, to get people talking. Any invalid character is replaced with a single space. I grabbed the list of invalid characters from the mozclassic code. This doesn't handle unicode, but neither does the rest of the function. invalidChars could be localized, but my suspicion is that they're the same on all Windows locales.
Keywords: patch, review
Target Milestone: mozilla1.0 → mozilla0.9.9
anyone have any thoughts?
*** This bug has been marked as a duplicate of 78509 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Keywords: nsbeta3
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: