CodeIgniter - URI Disallowed Characters

若如初见. 提交于 2020-01-02 20:59:35

问题


I had issue of @ which I added in $config['permitted_uri_chars'] as you can see below:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_@\-';

BUt here is my URL

http://mydomain.com/awarenessroom/facebook_image_share/aHR0cDovL2Rldi5lanVpY3lzb2x1dGlvbnMuY29tL3Jla2xhaW1wYWtpc3Rhbi5jb20vdXBsb2Fkcy9hd2FyZW5lc3Nfcm9vbS9pbWFnZXMvOTEwNzA4ODI3VG9yIERheSBaYW5qZWVyLmpwZw==

and it says "The URI you submitted has disallowed characters.", even if I add = in config, still not working. Can anybody let me know what is required exactly by CI in config to get resolved for URI to be working?


回答1:


As per your info you are using base64_encode so this i will suggest to you because i am following the same in my web application

$encode_string = "google.com";

$result = rtrim(base64_encode($encode_string ),'=');

$decoded_string = base64_decode($result);



回答2:


Please use url_encode(base64_encode(string)) and then decode it. It will help you for sure.




回答3:


use url_title() function

from this linkl http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html



来源:https://stackoverflow.com/questions/16271902/codeigniter-uri-disallowed-characters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!