• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is CodeIgniter decoding my URL input? If so how do I fix it?

#1
[eluser]Unknown[/eluser]
PLEASE NOTE: The spaces in my URL's are supposed to be percent symbols. I had to double urlencode my url just to post this, this forum doesn't support it very well.

I have a script that takes input that looks like this...

Code:
http://tracking.foobar1.com/9/1091/2115/u/http 3A 2F 2Fwww.foobar2.com 2Ftest-dir 2F

But when I do this in CI...

Code:
<?php
die(print_r($this->uri->uri_to_assoc(4),TRUE));
?>

I get this...

Code:
Array ( [1091] => 2115 [u] => http: [www.foobar.com] => testdir )

Instead of... (because my query string is decoded)

Code:
Array ( [1091] => 2115 [u] => http://www.foobar.com/testdir/ )

I backtraced this into CodeIgniter getting $_SERVER['QUERY_STRING'] and this is what I had...
Code:
$_SERVER['QUERY_STRING'] = /9/1091/2115/u/http:/www.foobar2.com/test-dir/
Instead of...
Code:
$_SERVER['QUERY_STRING'] = /9/1091/2115/u/http 3A 2F 2Fwww.foobar2.com 2Ftest-dir 2F

And I have the CI config.php setup with...
Code:
$config['uri_protocol'] = "QUERY_STRING"; //in the config.php file (due to it replacing '.' with '_')

It was working fine, but we recently did a migration and it's gone to sh*t (not positive it was the migration though), I thought it was Apache, but now I'm wondering if it's CodeIgniter or Apache, or if anybody has any ideas why the heck it would do this?

#2
[eluser]pickupman[/eluser]
Check $config['permitted_uri_chars'] characters in config.php and also $config['uri_protocol']. You may need to change to another value.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.