Welcome Guest, Not a member yet? Register   Sign In
What to expect from permitted_uri_characters
#1

[eluser]c77m[/eluser]
I've read several threads on related issues, and I have a few different ways to "fix" my issue. However, I'd really like to understand *why* I have the issue so I don't cause myself future headaches by making it work like I expect it to.

permitted_uri_characters is taken into account when generating URLs (eg. via title_url()), but that has no impact on the parameter string being available to the controller when the URL is loaded.

Example controller function:
Code:
function view($str = NULL)
{
    echo "str is '$str'";
}

Example view snippet that links to this function:
Code:
$name = 'john x. doe';
<a href="&lt;?= base_url() . url_title('thecontroller/view/' . $name) ?&gt;">Click here</a>

// Generated link is "http://localhost/thecontroller/view/john-x.-doe

Output from the controller:
Quote:str is 'john-x_-doe'

My expectation would be that permitted_uri_characters and url_title() would work together to create a link with accessible strings, but it does not. e.g. url_title would generate <b>john-x_-doe</b> or the function paramater would equal <b>john-x.-doe</b>.

Fixing this with a custom library is quite simple.. so simple that it makes me think I am missing something. Does a function already exist to produce URL strings that include only readable parameters?


Messages In This Thread
What to expect from permitted_uri_characters - by El Forum - 01-13-2011, 10:32 AM
What to expect from permitted_uri_characters - by El Forum - 01-13-2011, 11:08 AM
What to expect from permitted_uri_characters - by El Forum - 01-13-2011, 11:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB