Open Bug 282631 Opened 20 years ago Updated 3 years ago

editor allows insertion of invalid urls for links

Categories

(MailNews Core :: Composition, defect, P5)

x86
Windows 2000

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: Bienvenu, Unassigned)

Details

Attachments

(1 file, 1 obsolete file)

The editor allows you to enter a url for a link like www.mozilla.org - it used
to be that clicking on a link like that would assume it was an http url, but now
it doesn't. So I'm proposing inserting http:// at link creation time if no
protocol is specified.
Attached patch proposed fix (obsolete) — Splinter Review
Scott, who should I get r/moa= from in editor land?
Attachment #174611 - Flags: superreview?(mscott)
Comment on attachment 174611 [details] [diff] [review]
proposed fix

Daniel...he's on vacation right now though.
Attachment #174611 - Flags: superreview?(mscott)
Attachment #174611 - Flags: superreview+
Attachment #174611 - Flags: review?(daniel)
Comment on attachment 174611 [details] [diff] [review]
proposed fix

WOW....
What about mailto:foo@bar.org URL ??? It has no double-slash...
What about relative URLs ???
Attachment #174611 - Flags: review?(daniel) → review-
Boris, I've been meaning to pester you about this for a while. clicking on a
link w/o a protocol stopped working at some point, perhaps because of a security
fix - do you know if it was intentional?
A link without a protocol is just a relative link, and was always treated as
such, as far as I know....
in a mail message, it used to be the case that if you got a link like
www.mozilla.org, clicking on it would take you to http://www.mozilla.org - I
just checked with Netscape 7.1 - I believe that Moz 1.7 builds worked the same
way. Now, that may be evil/wrong, but it used to work, and there are
unfortunately users out there who are surprised that it stopped working.
> in a mail message, it used to be the case that if you got a link like
> www.mozilla.org, clicking on it would take you to http://www.mozilla.org

With plaintext or HTML mail?  The plaintext mail from bugzilla for comment 6 of
this bug has "www.mozilla.org" highlighted as a link in mailnews.  When I click
on it, it goes to http://www.mozilla.org.  I'm using SeaMonkey trunk
2005-02-18-05...

Note that in the DOM the link's href is "http://www.mozilla.org" in this case,
as expected -- the http-magic is in the plaintext-to-html converter mailnews
runs on messages.
I don't know if this will be acceptable to editor, but if we fork this file, I think this patch will help.
Attachment #174611 - Attachment is obsolete: true
Attachment #205858 - Flags: review?
Attachment #205858 - Flags: review? → review?(daniel)
Comment on attachment 205858 [details] [diff] [review]
handle anchors and mailto links

clearing request to re-request...
Attachment #205858 - Flags: review?(daniel)
Comment on attachment 205858 [details] [diff] [review]
handle anchors and mailto links

re-requesting review.
Attachment #205858 - Flags: review?(daniel)
Comment on attachment 205858 [details] [diff] [review]
handle anchors and mailto links


> function ValidateData()
> {
>   href = TrimString(gDialog.hrefInput.value);
>   // if no protocol specified, assume http://
>-  if (href.indexOf(":") == -1)
>+  if (href.indexOf(":") == -1 && href[0] != '#')
>     href = "http://" + href;

I don't understand this. If you want to create a link in the
editor to another document like <a href="foo.html">, the
patch above is going to break it and turn it into
<a href="http://foo.html"> ?
Attachment #205858 - Flags: review?(daniel) → review-
QA Contact: bugzilla → editor
not working on this - anyone is free to take it.
Assignee: bienvenu → nobody

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5

From point of view of Core, this is not a bug because it shouldn't be done in editor for web-compat of createLink command. It should be done before using the input value to editor. I.e., in the dialog or somewhere.

Moving to Thunderbird because of the reporter.

Status: NEW → UNCONFIRMED
Component: DOM: Editor → Composition
Ever confirmed: false
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: