Welcome Guest, Not a member yet? Register   Sign In
Allowing "+" in the query string?
#1

[eluser]taewoo[/eluser]
Hi everyone.
How can I allow the "+" string in the query string?

In appplication/config/config.php, i tried:

Code:
$config['permitted_uri_chars'] = '+a-z 0-9~%.:_-';
$config['permitted_uri_chars'] = '\+a-z 0-9~%.:_-';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_+-';
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\+-';

None of them seem to work.
Any thoughts on this matter?

PS: I am trying to allow query string when a user inputs search string (so that I can urlencode() and urldecode() the string... not to mention the user can embed the search string into their blog)
#2

[eluser]Noah David[/eluser]
Try this...

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_-\+';
#3

[eluser]taewoo[/eluser]
no good either
#4

[eluser]Noah David[/eluser]
Just tested this code, it will work for you:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.\:\_\-\+';
#5

[eluser]taewoo[/eluser]
EA Noah: Oh you sexy MAN! Thank you. I've been stressing over this for DAYS. You da shiznit!
#6

[eluser]Noah David[/eluser]
Anything I can do to help. Smile
#7

[eluser]jamesf[/eluser]
I've just been looking for a solution to this problem as well so thanks very much!
#8

[eluser]dtrenz[/eluser]
this works for me:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_+\-';

why do some people need to escape the chars while others don't?


that makes me nervous.
#9

[eluser]JulianM[/eluser]
The previous response is for 2008, and we are on 2009, but if any other had the same problem, try to use " double quotes instead of single quotes. (double quotes allow to scape characters like "\-" )

Thanks.

Julian


[quote author="dtrenz" date="1205351292"]this works for me:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_+\-';

why do some people need to escape the chars while others don't?


that makes me nervous.[/quote]
#10

[eluser]Dam1an[/eluser]
Seeing as its been brought up a whole year later, the reaon some thing needs to be escaped (aka '-') is because that means a range, such as 0-9 means any number between 0 and 9

If you put the '-' first, you don't need to escape it, as it can't mean a range then, but any other time, you need to




Theme © iAndrew 2016 - Forum software by © MyBB