Advertisement:

Author Topic: [SMF 2.0.2] WYSIWYG editor wrongly formates URL without the "http" prefix  (Read 5164 times)

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,766
  • Gender: Male
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.     
« Last Edit: August 18, 2012, 09:50:42 AM by Trekkie101 »
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!


Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,912
    • wedgebook on Facebook
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...

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 589
I think he's saying it's not just adding the http:// but an additional URL...?

Considering purchasing from SMFHacks.com?  Caveat emptor.  Details: http://www.simplemachines.org/community/index.php?topic=494081.msg3463426

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,766
  • Gender: Male
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.

My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!


Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,912
    • wedgebook on Facebook
Why should it, when the browser won't anyway?

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.

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,766
  • Gender: Male
Why should it, when the browser won't anyway?

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

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!


Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,912
    • wedgebook on Facebook
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

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,766
  • Gender: Male
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.
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!


Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,874
  • Gender: Male
  • Because Orange is Orange
There is for sure an inconsistency.
If I simply write:
Code: [Select]
www.something.comin the normal editor what I get is a link to:
Code: [Select]
http://www.something.comwhile using the WYSIWYG what I obtain is a link to:
Code: [Select]
http://www.simplemachines.org/community/www.something.comso 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.

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

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 589
I'd like to put forward that if a user types

Code: [Select]
www.anything.com
 ... if they get something OTHER than

Code: [Select]
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?
Considering purchasing from SMFHacks.com?  Caveat emptor.  Details: http://www.simplemachines.org/community/index.php?topic=494081.msg3463426

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,912
    • wedgebook on Facebook
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...

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,645
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.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Trekkie101

  • Doc Writer
  • SMF Hero
  • *
  • Posts: 8,100
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @trekkie101 on Twitter
    • DLRP Roundup
Still bugs up with new editor.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,874
  • Gender: Male
  • Because Orange is Orange
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.

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

Offline Trekkie101

  • Doc Writer
  • SMF Hero
  • *
  • Posts: 8,100
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @trekkie101 on Twitter
    • DLRP Roundup
Hit the URL button, delete the http:// and just put www.startrek.com in and it doesn't work?

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 589
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.
Considering purchasing from SMFHacks.com?  Caveat emptor.  Details: http://www.simplemachines.org/community/index.php?topic=494081.msg3463426

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,874
  • Gender: Male
  • Because Orange is Orange
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:
Code: [Select]
[iurl=http://www.something.com]www.something.com[/iurl]though that means I have to fine tune the distinction between url and iurl...

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

Offline Trekkie101

  • Doc Writer
  • SMF Hero
  • *
  • Posts: 8,100
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @trekkie101 on Twitter
    • DLRP Roundup
I was trying it with the latest git, and its there.

Online emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,874
  • Gender: Male
  • Because Orange is Orange
So even with the new editor the resulting post is with the http://yoursite.com/www.anothersite.tld?
What browser are you using?

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

Offline Trekkie101

  • Doc Writer
  • SMF Hero
  • *
  • Posts: 8,100
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @trekkie101 on Twitter
    • DLRP Roundup
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.