I have the following code that displays a simple form and posts it and CI 2 seems to already have url decoded the data before I decode it; so it gets double decoded. This only happens in CI 2. Is there a way to get this to work without using $_REQUEST?
Here is the code and output
function test()
{
if ($this->input->post('test'))
{
var_dump($_REQUEST['test']);
echo '<br ><br >';
var_dump(urldecode($this->input->post('test', FALSE)));
echo '<br ><br >';
var_dump(rawurldecode($this->input->post('test', FALSE)));
}
else
{
echo form_open('home/test');
echo form_hidden('test',"1bcw1kHHf0yTi8N%2bQGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl");
echo form_submit();
echo form_close();
}
}
Output:
Code igniter 2: (Notice the in the 2nd one there is NOT a "+" sign)
string(58) "1bcw1kHHf0yTi8N%2bQGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"
string(56) "1bcw1kHHf0yTi8N QGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"
string(56) "1bcw1kHHf0yTi8N+QGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"
Code igniter 3: (Works as expected)
string(58) "1bcw1kHHf0yTi8N%2bQGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"
string(56) "1bcw1kHHf0yTi8N+QGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"
string(56) "1bcw1kHHf0yTi8N+QGpdvsn4i7y3p2h1YAJnKy1QMS4iEgUQESIQEnSl"