Don't rewrite non http URLs in bbcode

https://www.phpbb.com/ideas/
Author:
Toxyy
Posted:
Wed May 30, 2018 8:43 pm
Rating:
Status:
Invalid
Ideas Bot
Registered User
Posts: 433
Joined: Sat Oct 13, 2012 10:06 am

Don't rewrite non http URLs in bbcode

Post by Ideas Bot » Wed May 30, 2018 8:43 pm

Here's the problem, assuming bbcode works correctly in phpbb ideas:

Code: Select all

[url]google.com[/url] or even [url=google.com]test url[/url]
google.com or even test url

Code: Select all

[url]http://google.com[/url] or even [url=http://google.com]test url[/url]
http://google.com or even test url

As you can see, URLs without http:// rewrite to the local url, myforum.com/google.com. I've never encountered this problem on any other forum system and I just tested this out on a few other forum systems before posting here. I'm not really sure why this quirk is hard coded in. It's not really a problem for those of us that add the http to the beginning, I figured that out a few minutes after making my thread in the support forum, but there's no reason to necessitate this behavior and just confuses noobs.

JimA fleshes out this idea here:
https://area51.phpbb.com/phpBB/viewtopi ... 91#p292291

Quoted:
Many inexperienced users that I know of always use the URL tag in order to post a URL, because they think that's the way it should be when posting one. For them this change might cause quite some confusion, they'll have no idea why all of a sudden the board URL is added to the one they post. For me too it sounds counter-intuitive to change a valid URL into one that clearly isn't.

Can't we get the best of both worlds and only make the URLs relative when someone posts a / first?

So that something like www.google.com would go to www.google.com and /images would go to http://area51.phpbb.com/images (the latter example already works this way)

This way it wouldn't break for people non too tech-savvy, and people that want relative links can easily use those too.
Anyone any thoughts on this?

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20008
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Don't rewrite non http URLs in bbcode

Post by Mick » Thu May 31, 2018 8:11 am

Mick wrote:
Thu May 31, 2018 7:02 am
Not using http or https when writing a url is a bad habit people have gotten in to especially with lots of sites going to SSL. https:// is important and so is ftp://
The noobs should be told the correct way to write a url and they’ll do it the right way for the rest of their lives.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

Toxyy
Registered User
Posts: 465
Joined: Mon Oct 24, 2016 3:22 pm

Re: Don't rewrite non http URLs in bbcode

Post by Toxyy » Thu May 31, 2018 6:22 pm

Mick wrote:
Thu May 31, 2018 8:11 am
Mick wrote:
Thu May 31, 2018 7:02 am
Not using http or https when writing a url is a bad habit people have gotten in to especially with lots of sites going to SSL. https:// is important and so is ftp://
The noobs should be told the correct way to write a url and they’ll do it the right way for the rest of their lives.
Maybe for smaller and medium sized forums it wouldn't be much of a problem sometimes, but for larger forums it would be pretty hard to moderate.

Someone clarified me in my thread that nothing is being rewritten, that's just how ahref's work. But again I say, even though it is bad practice to make links like this, phpbb is the only software that they don't work naturally on. This is a small quality of life feature, the only reasons I can think of to not implement it would be that it's not important right now.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

User avatar
Lumpy Burgertushie
Registered User
Posts: 64888
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Don't rewrite non http URLs in bbcode

Post by Lumpy Burgertushie » Thu May 31, 2018 6:32 pm

the main reason not to implement it is because it is not correct. phpbb.com is not a url, it is a domain name. www.phpbb.com is not a url and is not even really a domain name. having siad that, phpbb does change www.phpbb.com into a url for some reason.

if phpbb changes domain.com into a clickable url what happens if you did not intend for it to be a url.

I want to talk about domain names, so, I would maybe a post like this: " hey what do you think about these domain names?: yoyo.com, fafafa.com, memyselfandi.com"

if phpbb changes all of those domain names into urls it would make a mess of my post wanting to discuss possible domain names.

the way it is now is the correct way to do it in my opinion, I don't really care what other platforms do.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

Toxyy
Registered User
Posts: 465
Joined: Mon Oct 24, 2016 3:22 pm

Re: Don't rewrite non http URLs in bbcode

Post by Toxyy » Thu May 31, 2018 6:40 pm

Lumpy Burgertushie wrote:
Thu May 31, 2018 6:32 pm
I want to talk about domain names, so, I would maybe a post like this: " hey what do you think about these domain names?: yoyo.com, fafafa.com, memyselfandi.com"

if phpbb changes all of those domain names into urls it would make a mess of my post wanting to discuss possible domain names.
Well they're not in bbcode so it wouldn't make a mess of anything.

I'm not really all about telling people how to do something the correct way when I see no reason other than being nit picky about semantics that it shouldn't be allowed to work.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Heo32
Registered User
Posts: 85
Joined: Sat Jan 07, 2017 10:08 pm

Re: Don't rewrite non http URLs in bbcode

Post by Heo32 » Thu May 31, 2018 9:48 pm

I agree this idea, and I will explain why.

We all use a web browser. Personally, I use Firefox. If I highlight a bit of text that I know is a URL with my mouse, right-click it and select "Open Link in New Tab", then that means I am telling Firefox to treat that text as a URL even though it may not be following the rules as Lumpy Burgertushie pointed out.

Regardless of having "http://" or "https://" or "http://www." or "https://www." in place, I want that link to open no matter what. It could be for any of the examples listed below:

Code: Select all

google.com
www.google.com
http://www.google.com
https://www.google.com
As long as it has the following BBCode:

Code: Select all

[url]google.com[/url] or [url=google.com]test url[/url]
... then it should always be treated like a URL that can be opened in a new (or the same) tab, just as Firefox presently treats text that you can highlight with your mouse, right-click, and select "Open Link in New Tab".

So yes, I agree that this should get changed/fixed/implemented.
Is this for you? :arrow: Windows + Nginx + PHP + MySQL + phpBB + WordPress

Allow using Content-Security-Policy without unsafe-inline
stevemaury wrote:
Sun May 20, 2018 8:16 pm
I went to your board and looked for an hour or so, but did not see the women without underwear.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Don't rewrite non http URLs in bbcode

Post by Erik Frèrejean » Fri Jun 01, 2018 12:09 pm

Ideas Bot wrote:
Wed May 30, 2018 8:43 pm
Here's the problem, assuming bbcode works correctly in phpbb ideas:

Code: Select all

[url]google.com[/url] or even [url=google.com]test url[/url]
google.com or even test url

Code: Select all

[url]http://google.com[/url] or even [url=http://google.com]test url[/url]
http://google.com or even test url

As you can see, URLs without http:// rewrite to the local url, myforum.com/google.com. I've never encountered this problem on any other forum system and I just tested this out on a few other forum systems before posting here. I'm not really sure why this quirk is hard coded in. It's not really a problem for those of us that add the http to the beginning, I figured that out a few minutes after making my thread in the support forum, but there's no reason to necessitate this behavior and just confuses noobs.
Which is exactly the way a link is expected to behave, anything without domain is relative. Lets say I have a page on my website

Code: Select all

https://example.com/google.com
, with information about google. In that case blindly rewriting something that "appears" to be a domain will actually breaks the link.

You can't be sure that something that a string that looks like something that might be a domain is actually a domain and with that blindly rewrite it to be and external domain.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20008
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: Don't rewrite non http URLs in bbcode

Post by Mick » Fri Jun 01, 2018 12:59 pm

Heo32 wrote:
Thu May 31, 2018 9:48 pm
Regardless of having "http://" or "https://" or "http://www." or "https://www." in place, I want that link to open no matter what
But, you then have an address that doesn’t know how to behave. What if I posted an ftp address without ftp://, it would, presumably, try to use http which clearly won’t work. The same goes for http and https, how will that get served? It almost the same as giving someone your home address without a town name or a telephone number without the area code.
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

Heo32
Registered User
Posts: 85
Joined: Sat Jan 07, 2017 10:08 pm

Re: Don't rewrite non http URLs in bbcode

Post by Heo32 » Fri Jun 01, 2018 4:59 pm

Mick wrote:
Fri Jun 01, 2018 12:59 pm
But, you then have an address that doesn’t know how to behave. What if I posted an ftp address without ftp://, it would, presumably, try to use http which clearly won’t work. The same goes for http and https, how will that get served? It almost the same as giving someone your home address without a town name or a telephone number without the area code.
Yeah, you could say it might be an FTP. But how often do people post FTP links in forums? It's very rare, right? So unless "ftp://" is used, then it should be treated like a regular "http://" request. Regarding "http://" and "https://", websites are changing and evolving these days to adopt HTTPS. If a website only allows "https://", then it will do a 301 rewrite (port 80 to port 443) through the server configuration file and give a response using "https://". All links that do not specify "http://" or "https://" (e.g. "google.com" using BBCode as specified above) should be considered "http://" by default and let the website sort out if it stays as "http://" or if it should respond with an encrypted "https://" page. That part is not up to the user to figure out or decide. Nor should it be up to the BBCode to dictate that a URL link provides "http://" or "https://" in order to give a result. The website will deal with it. Although "https://" is more common than ever, it is not a default web standard. A default URL is "http://". A secure page using the "https://" protocol is just icing on the cake. That's why the configuration file exists for whatever website tool is used, be it Apache, Nginx, Litespeed, etc. It will sort out the request and it will give the correct result on it's own. At the moment, it just doesn't seem right to have a link respond with google.com (<- go on, click it) when clearly https://www.google.com/ was the intended URL.
Is this for you? :arrow: Windows + Nginx + PHP + MySQL + phpBB + WordPress

Allow using Content-Security-Policy without unsafe-inline
stevemaury wrote:
Sun May 20, 2018 8:16 pm
I went to your board and looked for an hour or so, but did not see the women without underwear.

User avatar
JoshyPHP
Code Contributor
Posts: 949
Joined: Mon Jul 11, 2011 12:28 am

Re: Don't rewrite non http URLs in bbcode

Post by JoshyPHP » Fri Jun 01, 2018 8:48 pm

Based on what I read the idea is in favor of rewriting relative URLs as absolute URLs. It means it would become impossible to post relative URLs.

That's something that can be added right now via an extension. Check out the extension docs, listen to the core.text_formatter_s9e_configure_after event and use the configurator instance to add an attribute filter.
I wrote the thing that does BBCodes in 3.2.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Don't rewrite non http URLs in bbcode

Post by Erik Frèrejean » Fri Jun 01, 2018 9:14 pm

Heo32 wrote:
Fri Jun 01, 2018 4:59 pm
At the moment, it just doesn't seem right to have a link respond with google.com (<- go on, click it) when clearly https://www.google.com/ was the intended URL.
How do you know what is "intended"?
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

Toxyy
Registered User
Posts: 465
Joined: Mon Oct 24, 2016 3:22 pm

Re: Don't rewrite non http URLs in bbcode

Post by Toxyy » Fri Jun 01, 2018 10:12 pm

Erik Frèrejean wrote:
Fri Jun 01, 2018 9:14 pm
Heo32 wrote:
Fri Jun 01, 2018 4:59 pm
At the moment, it just doesn't seem right to have a link respond with google.com (<- go on, click it) when clearly https://www.google.com/ was the intended URL.
How do you know what is "intended"?
If you type "google.com" in your browser and hit enter, would you go to phpbb.com/google.com or google.com?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Heo32
Registered User
Posts: 85
Joined: Sat Jan 07, 2017 10:08 pm

Re: Don't rewrite non http URLs in bbcode

Post by Heo32 » Sat Jun 02, 2018 11:39 am

Toxyy wrote:
Fri Jun 01, 2018 10:12 pm
If you type "google.com" in your browser and hit enter, would you go to phpbb.com/google.com or google.com?
Exactly.

Code: Select all

[url]google.com[/url]

Code: Select all

[url=google.com]test url[/url]
I don't see "phpbb.com" anywhere in that BBCode.
Is this for you? :arrow: Windows + Nginx + PHP + MySQL + phpBB + WordPress

Allow using Content-Security-Policy without unsafe-inline
stevemaury wrote:
Sun May 20, 2018 8:16 pm
I went to your board and looked for an hour or so, but did not see the women without underwear.

User avatar
AmigoJack
Registered User
Posts: 5324
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Don't rewrite non http URLs in bbcode

Post by AmigoJack » Mon Jun 04, 2018 11:07 am

Toxyy wrote:
Fri Jun 01, 2018 10:12 pm
If you type "google.com" in your browser and hit enter, would you go to phpbb.com/google.com or google.com?
But you type it into the address bar, not anywhere within other text. The context is more distinctive in there, but in post texts it's not. Don't mix up different contexts. We could also discuss how that in texts names should be in uppercase to recognize them and tell them from verbs or nous apart, and you would come up with the example "but in my login screen I can also write my name in lowercase" - that would be two different contexts, too.
The worst thing about censorship is ███████████

Toxyy
Registered User
Posts: 465
Joined: Mon Oct 24, 2016 3:22 pm

Re: Don't rewrite non http URLs in bbcode

Post by Toxyy » Mon Jun 04, 2018 8:46 pm

AmigoJack wrote:
Mon Jun 04, 2018 11:07 am
Toxyy wrote:
Fri Jun 01, 2018 10:12 pm
If you type "google.com" in your browser and hit enter, would you go to phpbb.com/google.com or google.com?
But you type it into the address bar, not anywhere within other text. The context is more distinctive in there, but in post texts it's not. Don't mix up different contexts. We could also discuss how that in texts names should be in uppercase to recognize them and tell them from verbs or nous apart, and you would come up with the example "but in my login screen I can also write my name in lowercase" - that would be two different contexts, too.
Have you ever written google.com and meant phpbb.com/google.com? Who has ever intended such a thing? All other web platforms seek to understand this concept...
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Post Reply

Return to “phpBB Ideas”

Who is online

Users browsing this forum: No registered users and 1 guest