Open Bug 1344266 Opened 8 years ago Updated 7 months ago

Attached file-link to event/task won't open: "Only http:// and https:// URLs are valid"

Categories

(Calendar :: General, enhancement)

Lightning 4.7.4
enhancement

Tracking

(Not tracked)

People

(Reporter: Johannes.mozdev, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 Build ID: 20170201175806 Steps to reproduce: Create a task with an URL attachment with file-protocol Actual results: Clicking on that URL when the task is selected won't do anything except showing following error in console: Invalid URL provided: file:///path/to/file.pdf Only http:// and https:// URLs are valid. source: chrome://calendar/content/calApplicationUtils.js line: 27 Only double or right clicking the URL when the task editing window is opened is working. Expected results: Clicking a URL pointing to a file should open the file also when the task is displayed. If it's not working, then the warning should shown to the user and not hidden in the error console.
Attached patch solve this issue.
Attachment #8843381 - Flags: review?(makemyday)
Assignee: nobody → Johannes.mozdev
Comment on attachment 8843381 [details] [diff] [review] Allow opening of file-URLs attached to tasks Review of attachment 8843381 [details] [diff] [review]: ----------------------------------------------------------------- Sorry for the delay in reviewing. To accept a patch this must be an applicable patch to our repository comm-central and not the packaged xpi. Can you provide such an patch, please? Apart from that, see the comment below. Philipp, do you have any objections to include the file handler protocol for this? ::: lightning-4.7.4-sm+tb-linux.xpi_FILES/chrome/calendar/content/calendar/calApplicationUtils.js @@ +22,5 @@ > // 0. Prevent people from trying to launch URLs such as javascript:foo(); > // by only allowing URLs starting with http or https. > // XXX: We likely will want to do this using nsIURLs in the future to > // prevent sneaky nasty escaping issues, but this is fine for now. > + if (!url.startsWith("http") && !url.startsWith("file")) { Can you make this if (!(url.startsWith("http") || url.startsWith("file:\\"))) { instead please?
Attachment #8843381 - Flags: review?(makemyday) → feedback+
Flags: needinfo?(philipp)
I don't have any objections.
Flags: needinfo?(philipp)
Assignee: Johannes.mozdev → nobody
Status: UNCONFIRMED → NEW
Ever confirmed: true
Type: defect → enhancement
Component: Tasks → General
Summary: Attached file-link to task won't open: "Only http:// and https:// URLs are valid" → Attached file-link to event/task won't open: "Only http:// and https:// URLs are valid"

Related to bug 168680

Severity: normal → S3
Attachment #9384948 - Attachment is obsolete: true
See Also: → 168680
Duplicate of this bug: 394324
Duplicate of this bug: 412417
Duplicate of this bug: 447727
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: