URL encoding in phpBB2 : How not to look foolish

What sort of sandwiches do you have?
Post Reply
User avatar
Dropdeadqt
Legendary
Posts:4895
Joined:05 Nov 2007, 01:27
Location:Brisbane
URL encoding in phpBB2 : How not to look foolish

Post by Dropdeadqt » 05 Jun 2008, 13:16

Cartollomew wrote:
Alleycat wrote: IMO it's blizzard spyware...
I don't much like it either - but it's part of the license we agree to to play the game they own. It's kinda like your bags being searched before you go in to play tennis, only the searcher follows you around with his hands down your pants the entire time.

And not in the good, Rico way, either.
lolz

Oh your tags are broken no tags - http://en.w ... (software)

Now it doesn't work at all...
Image

User avatar
Cartollomew
I has a monocle (Site Admin)
Posts:8805
Joined:22 Aug 2006, 12:11
Location:Perth

Post by Cartollomew » 05 Jun 2008, 13:21

It's a limitation of the phpBB parser for URLs. Anything that is a character that a 3 year old child wouldn't recognise is treated as a special character and is not considered part of a legit URL.

I can only assume that said 3 year old child designed the URL parser.

At any rate, things like apostrophes, spaces, brackets etc etc all need to be manually escaped to their URL-friendly code.

So left bracket is ( and right is )

http://en.wikipedia.org/wiki/Warden_(software)

This will give you a pretty URL that looks the way it should. The disadvantage is that phpBB, in its infinite wisdom, will cheerfully convert them in the DB to the "naughty" characters it doesn't like. So if you quote or edit a post with those encoded chars, the URL will break again, unless you manually change them back to the URL-friendly code.

The alternative (makes for ugly URLs that always work) is to use % to encode the hex value (found here for eg) of a character like so:

http://en.wikipedia.org/wiki/Warden_%28software%29

To de-uglify this horrid looking thing, use the [url] tags:
Haer iz teh lnik, do joo leik mudkipz?

This has been an unwelcome education.
The moar you know!

TLDR:
Use % and the hex number of the character you want, stick it in url tags:
%20 = space
%28 = (
%29 = )
etc etc
Last edited by Cartollomew on 05 Jun 2008, 13:40, edited 2 times in total.
Who do you think you are? If you'd stopped winning, you could have been the Biggest Loser, if you gave up, you could have been a Survivor, if you'd stopped reading Orwell, you could have been on Big Brother!

User avatar
Cartollomew
I has a monocle (Site Admin)
Posts:8805
Joined:22 Aug 2006, 12:11
Location:Perth

Re: URL encoding in phpBB2 : How not to look foolish

Post by Cartollomew » 26 Nov 2008, 18:57

The information in this thread no longer applies - we are running phpBB3, with added sex (oooh, ahhh).

Stick tags around a link and it'll work.

I promise (maybe).
Who do you think you are? If you'd stopped winning, you could have been the Biggest Loser, if you gave up, you could have been a Survivor, if you'd stopped reading Orwell, you could have been on Big Brother!

Post Reply