CodeIgniter Forums
permitted_uri_chars with slash - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: permitted_uri_chars with slash (/showthread.php?tid=78037)



permitted_uri_chars with slash - vekamizu - 11-22-2020

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!


RE: permitted_uri_chars with slash - php_rocs - 11-23-2020

@vekamizu,

Maybe this will be helpful to you ... https://codeigniter.com/userguide3/general/routing.html?highlight=uri


RE: permitted_uri_chars with slash - includebeer - 11-25-2020

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.