Can mangling of copy & pasted shortened URLs be prevented?

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
Martian
Registered User
Posts: 17
Joined: Fri May 13, 2005 10:26 am
Location: Olympus Mons
Contact:

Can mangling of copy & pasted shortened URLs be prevented?

Post by Martian »

It happens regularly on my forums that users directly select, copy & paste text from other posts to a new reply, so without using the quote-buttons. This gives problems when the copied text contains URLs that are shortened by the board: the copy & pasted URLs get mangled.

Is there some way to prevent this, so that shortened URLs will automatically become the original unshortened URLs when they are copy & pasted?

If this is possible, I would like to suggest that this feature is added to a future version of phpBB.
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1868
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Can mangling of copy & pasted shortened URLs be prevented?

Post by DavidIQ »

The answer would be no. You can't interface with the clipboard from a webpage without using some unfriendly methods so detecting that something from the page is being copied to the clipboard, then checking to see if one of these URLs is in there, and then changing it to the original is not going to be possible. The only other option would be to have an intermediate page where the links aren't shortened and then allow copying from there. Also your copy/pasting conundrum doesn't even take into consideration when a word is made into a URL.
Image
User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: Can mangling of copy & pasted shortened URLs be prevented?

Post by EXreaction »

It may be possible actually; there are tools to modify text copied (they typically add text to the end of the content copied). It sounds like the way they got around the issues with it was to modify the content when it's selected rather than when it's copied.

http://stackoverflow.com/questions/2026 ... d-web-text
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1868
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Can mangling of copy & pasted shortened URLs be prevented?

Post by DavidIQ »

I've read that stackoverflow response before, while trying to do something similar at my job, and the end result is, if you dig in deep enough: you would have to use some sort of flash plugin since there really isn't a solution that works well in all major browsers. I doubt we would want to include that with phpBB.
Image
Post Reply