http:// prepended to URLs after Preview.

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
mfearnley
Registered User
Posts: 3
Joined: Sat Feb 04, 2012 11:18 pm

http:// prepended to URLs after Preview.

Post by mfearnley »

Hi,
when using phpbb I tend to find that when I put in an URL like "www.example.com" and hit Preview, I find the preview shows it as "http://www.example.com" link (as expected), but the edit text has changed it to "http://www.example.com", i.e. appending "http://". But if I remove the "http://" and hit Submit (or don't preview), then "http://" is not appended in the final post.

Perhaps obviously, this doesn't happen if "Do not automatically parse URLs" is checked, unless I wrap it in ... tags.

Is this a bug or a feature? (To me it is serves as an annoyance because since the URL is detected either way I prefer to omit it for brevity, and it means I have to remove them manually after I preview.)
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52814
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: http:// prepended to URLs after Preview.

Post by Brf »

It should always put on http:// unless you have "Do not automatically parse URLs" checked.

Oh wait. I see what you are saying.... the link "text" has http:// add to it.
mfearnley
Registered User
Posts: 3
Joined: Sat Feb 04, 2012 11:18 pm

Re: http:// prepended to URLs after Preview.

Post by mfearnley »

Yeah, sorry my last post was a little wordy.
Perhaps an easier description would be:

Start a fresh post, type www.example.com.
If you Preview or Submit, the rendered text will show www.example.com (in a link), but the edit box text (if you've hit Preview) will have been changed to show http://www.example.com, which will obviously be reflected in the next Preview/Submit rendering unless removed.

This can also be seen with [url=www…]link[/url] and [url]www…[/url] links.
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: http:// prepended to URLs after Preview.

Post by Oyabun1 »

If you think it's a bug then add a ticket to the phpBB Bug Tracker.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Mick
Support Team Member
Support Team Member
Posts: 24232
Joined: Fri Aug 29, 2008 9:49 am
Contact:

Re: http:// prepended to URLs after Preview.

Post by Mick »

I'm not 100% on what your actual problem is. The URL BBCode requires HTTP to work, and, from what I can see, is added automatically if it's missing. I have to admit I never noticed that previously but I have never had a problem posting using the URL BBCode.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52814
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: http:// prepended to URLs after Preview.

Post by Brf »

The problem is that the text "http://"is added to the text that is linked.

Instead of

Code: Select all

<a href="http://www.example.com">www.example.com</a>
you get

Code: Select all

<a href="http://www.example.com">http://www.example.com</a>
Yeah. Report it to Bugtracker.
mfearnley
Registered User
Posts: 3
Joined: Sat Feb 04, 2012 11:18 pm

Re: http:// prepended to URLs after Preview.

Post by mfearnley »

I guess I would say the actual problem is that the forum is altering my text in a way that is:
a) unnecessary (since www works fine on its own)
b) not reflected in the rendering of the text in the preview/final submission until the next iteration, giving me a sort of "what you saw is what you get but you now don't see" (WYSIWYGBYNDS) sort of effect.

For what it's worth, my opinion is that it is useful to allow www links because they avoid clutter in both the edit text and the output rendering, but that's tangential to the bug, and I won't complain if the final decision is just to repair the disparity by "fixing" the immediate rendering.

I do recognise also that www is getting special treatment over myriad other URL forms that don't start that way, so in that sense it's not really "fair". Though that said, prepending 'http://' would still be a form of special treatment.

Anyway, I've submitted a report as advised at http://tracker.phpbb.com/browse/PHPBB3-10628. Thanks for your responses. I hope I've cleared up exactly what the problem is.
Locked

Return to “[3.0.x] Support Forum”