PHPBB3-14323 / PHPBB3-14332 - Link shortening

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
JoshyPHP
Registered User
Posts: 349
Joined: Fri Jul 08, 2011 9:43 pm

PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by JoshyPHP » Sun Dec 27, 2015 4:00 pm

https://tracker.phpbb.com/browse/PHPBB3-14323
https://tracker.phpbb.com/browse/PHPBB3-14332
https://github.com/phpbb/phpbb/pull/4059

Some URLs are automatically shortened in 3.1, not anymore in 3.2. I opened a PR for it but I know little about how it worked in 3.1 and what its purpose was. I read various comments about it and I'm afraid that people have different assumptions about it.

If you have any input about shortening links' text, let it be heard now or forever be ignored.
If you can't make a full post now, at least leave a comment to signal your intention to post at a later time.

Current PR works slightly differently from 3.1.
  • It shortens URLs posted as text as well as [url]...[/url] tags with no parameters. Does not apply to [url=...]...[/url]
  • The canonical URL of the board is determined at caching time because running generate_board_url() at posting time slightly scares me. It can be changed easily if someone can confirm that running generate_board_url() at posting time will not create a dependency nightmare, especially during testing.
  • All of it could be implemented as an extension.
Last edited by JoshyPHP on Thu Jan 07, 2016 8:06 pm, edited 1 time in total.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by DavidIQ » Mon Dec 28, 2015 2:55 pm

There was a function that would take care of shortening the URL in 3.1, correct? So shouldn't whatever the logic that was being done in that 3.1 function still be in place for 3.2? Not sure why there's different assumptions being brought up about it.
Image

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

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by JoshyPHP » Mon Dec 28, 2015 3:22 pm

Because there are a bunch of bug reports about that functionality too. Instead of copy/pasting the same thing and end up with the same issues, now would be the time to rethink it properly.

Also, make_clickable() and make_clickable_callback() take about ~200 lines, they do multiple things and the logic is not always immediately apparent.

User avatar
kinerity
Registered User
Posts: 22
Joined: Mon Sep 01, 2014 10:54 pm

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by kinerity » Sat Jan 02, 2016 3:00 am

JoshyPHP wrote:
Sun Dec 27, 2015 4:00 pm
  • All of it could be implemented as an extension.
This! While I have no doubt that shortening URLs has it's benefits, it also has drawbacks - the worst being you quote a post with a link like http://www.phpbb.com/community/viewtop...56 and it turns out exactly like that (obviously I made up the URL). I believe the same thing happens if you right click the link and select "Copy link address", but I'm not 100% sure on this.

User avatar
hanakin
Infrastructure Team
Infrastructure Team
Posts: 789
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by hanakin » Mon Jan 04, 2016 5:59 am

also as I pointed out in one of those tickets there needs to be some html changes to the output to allow for better control of the overall styling. basically adding a wrapping span around the text with a class on it... something simple like post-link-text

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by DavidIQ » Mon Jan 04, 2016 1:41 pm

kinerity wrote:
Sat Jan 02, 2016 3:00 am
I believe the same thing happens if you right click the link and select "Copy link address", but I'm not 100% sure on this.
:?: That would mean it was broken, which it wasn't. Quoting a shortened link would keep it short but the link would still work properly.
Image

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

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by JoshyPHP » Mon Jan 04, 2016 8:45 pm

hanakin wrote:
Mon Jan 04, 2016 5:59 am
also as I pointed out in one of those tickets there needs to be some html changes to the output to allow for better control of the overall styling. basically adding a wrapping span around the text with a class on it... something simple like post-link-text
Is that for link shortening or for every link?

User avatar
kinerity
Registered User
Posts: 22
Joined: Mon Sep 01, 2014 10:54 pm

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by kinerity » Tue Jan 05, 2016 4:04 am

DavidIQ wrote:
Mon Jan 04, 2016 1:41 pm
:?: That would mean it was broken, which it wasn't. Quoting a shortened link would keep it short but the link would still work properly.
I seem to remember this being a problem, but can't find the post now. :oops:

User avatar
Marc
Development Team Leader
Development Team Leader
Posts: 123
Joined: Thu Sep 09, 2010 11:36 am
Location: Munich, Germany

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by Marc » Wed Jan 06, 2016 10:57 am

You say it works slightly different form 3.1 but only state the way it works using your change. Please state what it used to work like on 3.1 for easier comparison.

Also, using generate_board_url() at caching time sounds fine to me, as the canonical URL should not change between cache refreshes.

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

Re: PHPBB3-14323 / PHPBB3-14332 - Link shortening

Post by JoshyPHP » Wed Jan 06, 2016 11:22 am

Marc wrote:
Wed Jan 06, 2016 10:57 am
Please state what it used to work like on 3.1 for easier comparison.
I don't really know how it used to work, that's why I created this topic.

Post Reply