Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 40

144.202.x.x forum
178.63.x.x forum
207.46.x.x dilbertplus
216.244.x.x dilbertplus
34.222.x.x user
46.229.x.x dilbertplus
46.229.x.x dilbertplus
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
5.9.x.x forum
54.196.x.x forum
54.36.x.x dilbertplus
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x user
54.36.x.x lgsl
54.36.x.x lgsl
54.36.x.x dilbertplus
54.36.x.x dilbertplus
54.36.x.x forum
54.36.x.x forum
54.36.x.x dilbertplus
54.36.x.x lgsl
54.36.x.x forum
54.36.x.x forum
62.210.x.x rss
66.249.x.x user
91.242.x.x guestbook

Last Seen

Wussie Mon 01:59
Dodgeitorelse Mon 16:49
85filip58 Wed 12:06
Bommel Mon 18:20
Apophis01 Wed 12:35

Newest Members

Forums
Strange url encode problem with long map name
Roachy
Mon Aug 30 2010, 05:34AM
Posts: 9
Joined: Thu Feb 25 2010, 03:03AM
Registered Member #5821
Hi there. Been using LGSL forever and love it. However a member of my forums recently pointed out a really weird occurence in our LGSL homepage module. I have no particular reason to believe this is a fault with LGSL, but I thought I'd post to see if someone can point me in the right direction.

I'm running the 5.8 standalone version, and I have modified it to use the map name ($server['s']['map']) within a link to point to the map's download location on our redirect server. For example if the map was named "dod_flash", the link would use that to point to "http://www.example.com/redirect/dod_flash.bsp.bz2".

I've never seen this problem with any other map (although I certainly haven't tested them all), but when the map being played is "dod_flugplatz_source_b4", the link doesn't work. If you click on it your browser opens a new tab with the correct URL in the URL bar, but for some reason it will tell you the link cannot be found. If you copy the URL from the URL bar, or if you copy the URL by right clicking the link and selecting "copy link address", and then paste the link in a text-editor, this is what you will see:

http://www.example.com/redirect/dod_flugplatz_source%E2%80%8B_b4%E2%80%8B.bsp.bz2


I looked up the values for those percent-encoded characters, but they seem to be somewhat random. %E2 is a lowercase A with a carrot over it (^), %80 is the Euro sign (I think), and %8B is the less-than sign (<).

I have no idea where those extra characters are coming from, and why it isn't a problem with other maps. My best guess is that somewhere in LGSL it uses some sort of url encoding function before outputting text, and that for some reason, the long map name is breaking it. But that's just a wild guess.

Any ideas? Thanks for an otherwise fantastic web-app!
Website
Rich
Tue Aug 31 2010, 06:17AM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

$server = lgsl_server_html($server);

This function not only converts symbols to html entities, it also wraps long words with an invisible break.

So what you are seeing ( or not seeing ) is the invisible break.

The way round this is to construct your download URL before the lgsl_server_html function is called.


foreach ($server_list as $key => $server)
{
  $download = "http://www.example.com/{$server['s']['map']}.bsp.bz2";
  $server = lgsl_server_html($server);

Website
Roachy
Tue Aug 31 2010, 03:44PM
Posts: 9
Joined: Thu Feb 25 2010, 03:03AM
Registered Member #5821
I see. Many thanks!
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org