colon in the URL escaped as %3A

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Potjiekos
Posts: 11
Joined: Wed Oct 20, 2010 6:57 pm

Re: colon in the URL escaped as %3A

Post by Potjiekos » Thu Oct 21, 2010 7:58 am

Will you please paste that code from cms.php line 125 to 135 here. So I can see what it looks like. Cus I've tried that before and mine failed.

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: colon in the URL escaped as %3A

Post by Gert » Thu Oct 21, 2010 8:26 am

Line before (line 130 in my cms.php):

Code: Select all

$su = substr($su, 0, $cf['uri']['length']); 
Added line:

Code: Select all

$su = preg_replace('/%3A/i',':',$su); # sometimes the colon in the URL is escaped as %3A      
Together:

Code: Select all

...
$su = substr($su, 0, $cf['uri']['length']);
$su = preg_replace('/%3A/i',':',$su); # sometimes the colon in the URL is escaped as %3A 
... 
Works with ":" as uri_seperator.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Potjiekos
Posts: 11
Joined: Wed Oct 20, 2010 6:57 pm

Re: colon in the URL escaped as %3A

Post by Potjiekos » Thu Oct 21, 2010 8:47 am

Gert wrote:":" or "/" as uri_separator - it's the same problem, so we should let the ":".

I have tried the solution from jze (first post), it works for me (with ":" as uri_seperator).
Have you tried it with a facebook Like plugin -- I have done as prescribed in the 1st post. No luck so var. The facebook Like Button works in the H1 pages, but fails when its H2 & H3 subheadings.

Let me 1st do what you have done and then see....OK

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: colon in the URL escaped as %3A

Post by Gert » Thu Oct 21, 2010 8:54 am

Potjiekos wrote:Have you tried it with a facebook Like plugin
Sorry, but I'm not a facebook user ...
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Potjiekos
Posts: 11
Joined: Wed Oct 20, 2010 6:57 pm

Re: colon in the URL escaped as %3A

Post by Potjiekos » Thu Oct 21, 2010 8:59 am

My Url is perfect, but when I go to thia page on facebook http://developers.facebook.com/docs/ref ... ugins/like and place it into the the "URL to like", then hit "Get Code". The url code that is then returned to me gives me the foulty code. (It gives 2 sets of code: HTML and JS) The Java script one I cant get to work.

Gert Try it!

Visit this http://potjie-boula.zxq.net/cmsxh/?How_ ... H3_heading

Johan

Potjiekos
Posts: 11
Joined: Wed Oct 20, 2010 6:57 pm

Re: colon in the URL escaped as %3A

Post by Potjiekos » Thu Oct 21, 2010 9:06 am

Gert wrote:
Potjiekos wrote:Have you tried it with a facebook Like plugin
Sorry, but I'm not a facebook user ...
Ohhh I did not know. The Idea is thatthe facebook user kliks on the link in my website, which in turn sends a link on his facbook page for his friends to see. His friends then becomes trafic to my webpage in return. I market a social product and it usaly works when friends are al around.

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: colon in the URL escaped as %3A

Post by Gert » Thu Oct 21, 2010 9:38 am

The changed/added code works only with ":" as uri_seperator.

If you want to use "/" as uri_seperator you have to replace "%3A" by "%2F":

Code: Select all

$su = preg_replace('/%2F/i',':',$su); # sometimes the question mark in the URL is escaped as %2F      
(not tested)

But the best way is to set your uri_seperator back to ":" and try again with "%3A" in the added line of the cms.php.
Last edited by Gert on Thu Oct 21, 2010 10:21 am, edited 2 times in total.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: colon in the URL escaped as %3A

Post by Gert » Thu Oct 21, 2010 9:54 am

Ah, now I understand. That code on your CMSimple-page:

Code: Select all

<iframe scrolling="no" frameborder="0" allowtransparency="true" style="border: medium none; overflow: hidden; width: 450px; height: 80px;" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fpotjie-boula.zxq.net%2Fcmsxh%2F%3FHow_to_create_pages%2FAn_H2_heading%2FAn_H3_heading&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80"></iframe>
creates facebook?

Update: here it works perfect (my doughter have a facebook-account):

http://www.ge-webdesign.de/xhtestutf8/? ... H3_heading

Update2: But we shouldn't add it to CMSimple_XH source, because: If someone uses a colon in h1-h3 => the page is not reachable anymore, not in view mode and not in edit mode.
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: colon in the URL escaped as %3A

Post by Holger » Thu Oct 21, 2010 1:14 pm

You should not change that in CMSimple. I think it's a problem with the scripts from Facebook.
There should not be a problem with a urlencoded colon - that's the "normal" way.
And you'll run into problems with othe special characters, like "Ö Ü Ä" and so on.

@Potjiekos:
Can you please check if a unencoded src in the iframe work and if Facebook creates a working link to the page?
I can't test it, I'm not on Facebook...

Code: Select all

http://www.facebook.com/plugins/like.php?href=http://potjie-boula.zxq.net/cmsxh/?How_to_create_pages/An_H2_heading/An_H3_heading&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80
Holger

Potjiekos
Posts: 11
Joined: Wed Oct 20, 2010 6:57 pm

Re: colon in the URL escaped as %3A

Post by Potjiekos » Thu Oct 21, 2010 3:52 pm

Holger wrote:You should not change that in CMSimple. I think it's a problem with the scripts from Facebook.
There should not be a problem with a urlencoded colon - that's the "normal" way.
And you'll run into problems with othe special characters, like "Ö Ü Ä" and so on.

@Potjiekos:
Can you please check if a unencoded src in the iframe work and if Facebook creates a working link to the page?
I can't test it, I'm not on Facebook...

Code: Select all

http://www.facebook.com/plugins/like.php?href=http://potjie-boula.zxq.net/cmsxh/?How_to_create_pages/An_H2_heading/An_H3_heading&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80
Holger
Holger

-- I followed your instruction, but landed the first time in the home page. Then I treid again (cant remember what I changed) then I came up with a 404. In both casses the Facebook plugin reported an error. I agree with you that SMSimple have got valid URL's. It is facebook. Even if I change the url on my side it will be rewritten in facebook. Thus making the URL useless. We should experiment further, even though this looks like a facebook problem. Maybe facebook must look at their MOD_REWRITE files.

Post Reply