Welcome Guest, Not a member yet? Register   Sign In
Changing $config['permitted_uri_chars']
#1

[eluser]mdavis1982[/eluser]
Hi all...

I have just almost finished developing my first CI application, and I must say what a breeze it was to do!

I now need to allow apostrophes in the URL so that people can't search my database by title. I know it's not the most secure of things, but it is a client requirement.

I have changed my $config['permitted_uri_chars'] to:
Code:
$config['permitted_uri_chars'] = "a-z 0-9\'~%.:_-";

To which I have added the ' and the \. My problem is that when I now submit an url from my form which contains an apostrophe, I'm getting an URL like:

http://localhost/search/title/don\'t

This obviously doesn't look very nice, and I'd really like to get rid of the \ before the '. Does anyone have any ideas?

Thanks...

Matt
#2

[eluser]Chris Newton[/eluser]
If you really need apostrophes in things, maybe you should be sending them through post, instead of through the URI.
#3

[eluser]mdavis1982[/eluser]
Maybe I should, but I also need bookmarkable searches.

I just need to know how to do it.

Thanks.
#4

[eluser]Chris Newton[/eluser]
URLencode your string then

http://www.php.net/urlencode

You can encode on the upside, and decode on the down.




Theme © iAndrew 2016 - Forum software by © MyBB