08-23-2010, 08:32 AM
[eluser]escape[/eluser]
Hello,
As posted numerious times in this forum, users encounter situations where CI changes certain characters in a URI to underscores. And in most cases this can be resolved by changing the URI protocol to "REQUEST_URI" or whatever seems to work on your server.
Although I have used this method in the past with success, I'm concerned that changing the URI protocol will introduce unexpected results in other parts of the application.
For example, I have a CI controller which accepts a URI containing decimal numbers. The numbers are passed into a function via the argument list like:
If I do not want to change the URI protocol I simply do this:
And life is good.
The point of my post is, can a developer experience unexpected concequences when they change the URI Protocol to fix one thing then discover that change affects something else in the program?
Thanks,
Chris
Hello,
As posted numerious times in this forum, users encounter situations where CI changes certain characters in a URI to underscores. And in most cases this can be resolved by changing the URI protocol to "REQUEST_URI" or whatever seems to work on your server.
Although I have used this method in the past with success, I'm concerned that changing the URI protocol will introduce unexpected results in other parts of the application.
For example, I have a CI controller which accepts a URI containing decimal numbers. The numbers are passed into a function via the argument list like:
Code:
function crunch_number($decimal)
{
echo $decimal;
}
INPUT: www.mydomain.com/mycontroller/crunch_number/5.369
OUTPUT: 5_369
Where, CI converts the decimal numbers to strings with an underscore
If I do not want to change the URI protocol I simply do this:
Code:
function crunch_number($decimal)
{
echo str_replace('_', '.', $decimal);
}
INPUT: www.mydomain.com/mycontroller/crunch_number/5.369
OUTPUT: 5.369
And life is good.
The point of my post is, can a developer experience unexpected concequences when they change the URI Protocol to fix one thing then discover that change affects something else in the program?
Thanks,
Chris