PHPBB3-14535 [url] works unexpected

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
Joe User
Registered User
Posts: 32
Joined: Mon Sep 13, 2004 10:10 am
Location: Germany
Contact:

PHPBB3-14535 [url] works unexpected

Post by Joe User »

This demonstrating link should not be a link.
FreeBSD Remote InstallationPayPal.Me/JoeUser
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task,
and one of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
rxu
Registered User
Posts: 164
Joined: Tue Apr 04, 2006 4:28 pm
Contact:

Re: PHPBB3-14535 [url] works unexpected

Post by rxu »

Code: Select all

[url]www.phpbb.com[/url]
www.phpbb.com
Image

CHItA
Development Team
Development Team
Posts: 169
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: PHPBB3-14535 [url] works unexpected

Post by CHItA »


CHItA
Development Team
Development Team
Posts: 169
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: PHPBB3-14535 [url] works unexpected

Post by CHItA »

JoshyPHP wrote: Poke
What is your take on this?

Joe User
Registered User
Posts: 32
Joined: Mon Sep 13, 2004 10:10 am
Location: Germany
Contact:

Re: PHPBB3-14535 [url] works unexpected

Post by Joe User »

FreeBSD Remote InstallationPayPal.Me/JoeUser
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task,
and one of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

Joe User
Registered User
Posts: 32
Joined: Mon Sep 13, 2004 10:10 am
Location: Germany
Contact:

Re: PHPBB3-14535 [url] works unexpected

Post by Joe User »

FreeBSD Remote InstallationPayPal.Me/JoeUser
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task,
and one of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: PHPBB3-14535 [url] works unexpected

Post by JoshyPHP »

CHItA wrote: Sun Mar 13, 2016 6:11 pm What is your take on this?
It's by design. The URL filter accepts valid URLs, including protocol-relative URLs and other relative URLs.

If you want to reject relative URLs you can add another filter with this:

Code: Select all

$configurator->tags['URL']->attributes['url']->filterChain->append('#regexp')->setRegexp('#^\\w+://#');
You'd have to do that for every URL attribute that you want to force though. I would consider adding an option to the default URL filter but I'm not sure about the added complexity when there's already a workaround available. That doesn't seem worth it.

In case I decide to add an option, I'm open to suggestions for the name or the property or method in the UrlConfig object used to configure URL options. Probably something like this:

Code: Select all

$configurator->urlConfig->requireScheme = true;
$configurator->urlConfig->requireHost   = true;

// Or maybe this
$configurator->urlConfig->requireParts('scheme,host');

CHItA
Development Team
Development Team
Posts: 169
Joined: Thu Mar 12, 2015 1:43 pm
Location: Budapest, Hungary

Re: PHPBB3-14535 [url] works unexpected

Post by CHItA »

I think with what we have in the editor with the link button's help message, it should be clear that you need to specify the protocol, which is different in some cases from the 3.1 behaviour, but IMHO it is an improvement. Probably, it would be nice to add some more configuration options in the ACP, but if I understand you correctly, then that should be possible. I'll close the ticket as won't fix for now, thanks for the help.

User avatar
JimA
Former Team Member
Posts: 66
Joined: Sun Aug 24, 2008 2:29 pm

Re: PHPBB3-14535 [url] works unexpected

Post by JimA »

I just want to come back to this once more since we've just got a support request based on this change.

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 [url]www.google.com[/url] would go to www.google.com and [url]/images[/url] 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?
Image Jim Mossing Holsteyn - Moderator Team Member
Knowledge Base | Documentation | Board rules

No support here on Area51, please visit the Support forums over at phpBB.com

Rhino.Freak
Registered User
Posts: 48
Joined: Thu Dec 24, 2015 10:47 am

Re: PHPBB3-14535 [url] works unexpected

Post by Rhino.Freak »

^ that sounds perf.
I support it!

Post Reply