Welcome Guest, Not a member yet? Register   Sign In
how to permit the "?" and "=" in the url ?
#1

[eluser]quasiperfect[/eluser]
i tried to add the chars to the permitted uri in the config
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-?=';
but i get a error
Code:
A PHP Error was encountered

Severity: Warning

Message: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 20

Filename: libraries/URI.php

Line Number: 189

An Error Was Encountered

The URI you submitted has disallowed characters.
#2

[eluser]TheFuzzy0ne[/eluser]
You need to escape the question mark:
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\?=';

Why do you need to use those characters? If you really need to use query strings, you should enable that via your config.php file. I don't believe you need to add those characters, but I'm not sure.

Using an htaccess file can negate the need to use a question mark, and using [url="http://ellislab.com/forums/viewthread/106502/#536309"]my alternate URI syntax library[/url] can negate the need to use "=".
#3

[eluser]quasiperfect[/eluser]
tried
Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\?=';
i get a 404
my url is like this
Code:
http://localhost/codeigniter/controler/method/?var=value
i don't need anything after the method

i only need this for 3 controllers and idea i would love not to enable qs and permit the chars globally but i have no choice i need this for some flash files that are compiled and i have no source
#4

[eluser]xwero[/eluser]
The auto uri_protocol grabs the query_string with one key-value pair as the controller. It won't even reach the permitted_uri_chars check.
#5

[eluser]quasiperfect[/eluser]
@xwero what do u mean ?
basicly all i need is to clean the url before it get's to codeigniter i don't need the parameters added by flash
#6

[eluser]xwero[/eluser]
no change the uri_protocol setting to something that is not query_string or auto and you will be able to use the clean urls with a query string.
#7

[eluser]quasiperfect[/eluser]
@xwero what do u advice to use PATH_INFO,REQUEST_URI or ORIG_PATH_INFO ?
now i replaced with PATH_INFO and i replaced the uri lib with my modified version of the lib and it works
the only change i made to the lib is in _fetch_uri_string
i added
Code:
if (stripos($_SERVER['QUERY_STRI],'=')!== false)
{
$_SERVER['QUERY_STRI] = str_ireplace('//','/',preg_replace('/flashvar=[0-9]{4,8}/','',$_SERVER['QUERY_STRI]));
}
if (stripos($_SERVER['REDIRECT_QUERY_STRING'],'=')!== false)
{
$_SERVER['REDIRECT_QUERY_STRING'] = str_ireplace('//','/',preg_replace('/flashvar=[0-9]{4,8}/','',$_SERVER['REDIRECT_QUERY_STRING']));
}
if (stripos($_SERVER['REQUEST_URI'],'?flashvar=')!== false)
{
$_SERVER['REQUEST_URI'] = str_ireplace('//','/',preg_replace('/\?flashvar=[0-9]{4,8}/','',$_SERVER['REQUEST_URI']));
}
#8

[eluser]pistolPete[/eluser]
You shouldn't hack core files.

You can adjust the setting in ./system/application/config/config.php :
Code:
$config['uri_protocol'] = ?
#9

[eluser]MEM[/eluser]
Hello,

I was having the same issue:


@pistolPete

That will return a sintax error.
And even if we do = "?" - No luck.

If I change the $config['uri_protocol'] to:
Code:
$config['uri_protocol'] = REQUEST_URI;

It works.

I realise that this post has several months old. Still, if someone drops by...


Regards,
MEM
#10

[eluser]Zulkifli Said[/eluser]
i was having the same issue too..
i try to change $config['uri_protocol'] = "PATH_INFO";

it works...




Theme © iAndrew 2016 - Forum software by © MyBB