Welcome Guest, Not a member yet? Register   Sign In
URL character bug?
#1

[eluser]Peter Dräxler[/eluser]
Hi.

Controller skusanie:
Code:
class Skusanie extends Controller
{
    function echooo($echo)
    {
        header('Content-type: text/plain');
        echo $echo;
    }
}

my URL: http://domain.tld/skusanie/echooo/HPVQ726EA#AKR
(In URL I have % 23 but forum decode it.)

Output:
Quote:HPVQ726EA

If I will put to URL encoded character #, string was cutted.

If It's not bug, I'm sorry. Please correct me.

Thank you.

Sorry for my english.
#2

[eluser]WanWizard[/eluser]
Read up on the specifications.

A hash or pound sign (#) can not be part of the URL, it is used to select an anchor in the page. If you submit such a URL, the webserver will strip is as it has no meaning on a server, only on a client.

If you want that sign as part of the URL, you have to encode it.
#3

[eluser]Peter Dräxler[/eluser]
Thank you for reply.

I was encoded this character to % 23, but this forum was decode it.
#4

[eluser]WanWizard[/eluser]
Encoding it using % 23 doesn't help, the webserver will decode it and strip it again.

You might try a urlencode(html_entitities($var)), but that will only work for URL's you craft yourself. There are some discussings about trying to handle this with mod_rewrite, but as far as I can see the # part of the URL is already stripped when it is passed to mod_rewrite.
#5

[eluser]Peter Dräxler[/eluser]
OK, Thank's.




Theme © iAndrew 2016 - Forum software by © MyBB