您可以通过config/config.php和permitted_uri_chars
密钥允许某些标志。
但是,尽管我不完全确定,但我相信这些默认情况下会受到限制以提高安全性。正如相关解释所暗示的:
/*
|--------------------------------------------------------------------------
| Allowed URL Characters
|--------------------------------------------------------------------------
|
| This lets you specify with a regular expression which characters are permitted
| within your URLs. When someone tries to submit a URL with disallowed
| characters they will get a warning message.
|
| As a security measure you are STRONGLY encouraged to restrict URLs to
| as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
|
| Leave blank to allow all characters -- but only if you are insane.
|
| DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
|
*/
例如,当前设置的巧妙之处在于,您只允许很少的 uris 来解析 ID,而不会冒险让它们受到 .''
或""
类似的影响。当然有自动和手动$this->db->escape()
,但这只是增加了更多的故障保护。