Welcome Guest, Not a member yet? Register   Sign In
permitted_uri_chars with slash
#1

(This post was last modified: 11-24-2021, 08:39 PM by vekamizu.)

Hello,

adding in url address like

Code:
encodeURIComponent("Collinsfield street 5/a")


I found that ci3 does not find this ulr even after in app application/config/config.php file in line



Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-+,\.';



I added 2 chars at end of condition.



Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-+,\.\/';

we tried to make for you the best porn site you could imagine https://bestpornever.me

Which is the correct way?

Thanks!
Reply
#2

@vekamizu,

Maybe this will be helpful to you ... https://codeigniter.com/userguide3/gener...hlight=uri
Reply
#3

encodeURIComponent("Collinsfield street 5/a") will give "Collinsfield%20street%205%2Fa", which should be valid.
But since '/' is an URI separator, maybe it cause confusion even if you use encodeURIComponent() to translate it to "%2F".

My guess is CodeIgniter convert it back to / and look for a route that doesn't exists. You should probably use '-' instead of '/' to avoid this.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB