gpt4 book ai didi

php - 带有 Firefox 和不允许的关键字符的 CodeIgniter

转载 作者:行者123 更新时间:2023-12-04 16:38:45 24 4
gpt4 key购买 nike

最近我下载了 codeIgniter 2.1.1。我将 CI 文件放在 Windows 7 的 wamp 上,之后我打开 firefox 并输入 localhost,我看到了这条消息 “Disallowed Key Characters”但是,我在 Chrome 和 Opera 上没有这个问题。

最佳答案

system/core/Input.php第728行有这段代码:

<?php 
/**
* Clean Keys
*
* This is a helper function. To prevent malicious users
* from trying to exploit keys we make sure that keys are
* only named with alpha-numeric text and a few other items.
*
* @access private
* @param string
* @return string
*/
function _clean_input_keys($str)
{
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str))
{
exit('Disallowed Key Characters.');
}

// Clean UTF-8 if supported
if (UTF8_ENABLED === TRUE)
{
$str = $this->uni->clean_string($str);
}

return $str;
}
?>

它检查 key=>value 对中的键,例如:example.com?key=value 如果你的键不在 a-z0-9:_/- 范围内,它会抛出那个错误。

更改 exit('Disallowed Key Characters.');

exit('Disallowed Key Characters.'.$str); 让您了解哪个键出了问题。请记住,这可能是通过 $_REQUEST/$_COOKIE 检查 cookie,因此清除 cookie 也是一个好主意,也许是从同一路径上的旧脚本或版本。

希望对你有帮助

关于php - 带有 Firefox 和不允许的关键字符的 CodeIgniter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11491546/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com