[SMF 2.0.2] WYSIWYG editor wrongly formates URL without the "http" prefix

Started by Masterd, June 27, 2012, 12:20:42 PM

Previous topic - Next topic

Masterd

I'm sorry if this has been reported before but it seems that I can't find a topic related to it.

Oh boy, I'm getting old. I found this out when I was testing RC3 few years ago (or was it a year ago?) when I had some rather serious business (well, it depends on your definition of serious :P) and I wrote it down so I can report it later. Unfortunately I forgot about this until today.

Replication was successful on several sites running the latest SMF 2.0.2. It is replicable on this site. Simply, if you enable WYSIWYG and then enter an URL without the "http" prefix, for example: www.something.com, it will be wrongly formated so now it will link to http://www.forum.com/www.something.com.     

Arantor

That's not really a bug in the editor, that's how HTML actually works if you do a link without the http in front of it...

FrizzleFried

I think he's saying it's not just adding the http:// but an additional URL...?


Masterd

Quote from: Arantor on June 27, 2012, 12:21:30 PM
That's not really a bug in the editor, that's how HTML actually works if you do a link without the http in front of it...

To be honest, I never actually took a look at the WYSIWYG editor's code but I always thought it was coded to "apprehend" such things.


Arantor

Why should it, when the browser won't anyway?

Quote from: FrizzleFried on June 27, 2012, 12:26:52 PM
I think he's saying it's not just adding the http:// but an additional URL...?

Yes, it'll put the forum's domain (and possibly path, circumstance depending) in front of it - because that's how HTML itself deals with such things.

Masterd

Quote from: Arantor on June 27, 2012, 12:31:31 PM
Why should it, when the browser won't anyway?

This is What You See I What You Get editor, right?

Arantor

It doesn't really matter whether it is or not.

Add this to your template somewhere: <a href="mypage.html">my page</a> and where does the link take you? It certainly doesn't take you to http://mypage.html

Masterd

Quote from: Arantor on June 27, 2012, 03:36:41 PM
It doesn't really matter whether it is or not.

Add this to your template somewhere: <a href="mypage.html">my page</a> and where does the link take you? It certainly doesn't take you to http://mypage.html

Ofcourse not. It's just the way how HTML behaves. But here we are talking about "super advanced Web 2.0 editor". The main role of using WYSIWYG editor is to get what you see. And in this case it's simply not happening.

emanuele

There is for sure an inconsistency.
If I simply write:
www.something.com
in the normal editor what I get is a link to:
http://www.something.com
while using the WYSIWYG what I obtain is a link to:
http://www.simplemachines.org/community/www.something.com
so I feel one of the two is wrong.

BTW in 2.1 there is a similar situation, but less evident since the http://www.simplemachines.org/community/www.something.com will appear only as title of the link in the WYSIWYG editor but will not be converted by the editor itself.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

FrizzleFried

I'd like to put forward that if a user types

www.anything.com

... if they get something OTHER than

http//www.anything.com

as the end result... that would be the wrong way of doing things.  I don't "care" how HTML works... the bottom line is that it is illogical to expect anything other than the same URL you type in but PERHAPS with the http:// added... to be a true WYSIWYG... no?

Arantor

No, because other editors do exactly the same thing, because yo udon't always want absolute links, there are plenty of times you just want to link to somewhere else on the same site...

MrPhil

I would rather see the whole "auto link" business dropped. You want a domain name to be a link? You wrap it in [url]http:// .. [/url]. Right now SMF is assuming anything starting with www. (but not http://www.) is an implied link. I think this has caused more problems (and work) than it has saved typing. It's also inconsistent (mysub.domain.com is not linked). As an example, there's another thread going on about [img]http://cache.www.domain.com getting turned into [img]http://cache.[url]www.domain.com.

Even in this simple post, I had to add "nobbc" tags to stop SMF from turning URLs into links.

Trekkie101


emanuele

Are you sure?
I just tested it again, but it seems to work "properly": it is not changed and it is auto-linked when displayed.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Trekkie101

Hit the URL button, delete the http:// and just put www.startrek.com in and it doesn't work?

FrizzleFried

www.startrek.com

Sure looked to work fine here.

Actually nope... it's jacked.  Click the URL button,  put in www.startrek.com and the above URL comes up...

(hxxp://www.simplemachines.org/community/www.startrek.com) with the proper URL NAME attached.  Something is seriously screwed up.

emanuele

Quote from: Trekkie101 on August 18, 2012, 10:02:32 AM
Hit the URL button, delete the http:// and just put www.startrek.com in and it doesn't work?
Did you also post the message?
It looks fine here once posted.
The resulting message contains:
[iurl=http://www.something.com]www.something.com[/iurl]
though that means I have to fine tune the distinction between url and iurl...


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Trekkie101


emanuele

So even with the new editor the resulting post is with the http://yoursite.com/www.anothersite.tld?
What browser are you using?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Trekkie101

Quote from: emanuele on August 18, 2012, 11:36:41 AM
So even with the new editor the resulting post is with the http://yoursite.com/www.anothersite.tld?
What browser are you using?

Yes, Safari 6, I'm sending you a PM with details to have a play.

Advertisement: