所提交的网址带有不被接受的字符

发布于 2024-07-09 18:11:43 字数 112 浏览 8 评论 0原文

我有一个代码点火器项目,我想尝试使用 Zend Studio 调试它。 当我开始调试时,我立即运行 ino

“您提交的 URI 包含不允许的字符”。

有人有什么主意吗?

I have a code igniter project, and I wanted to try debugging it using Zend Studio. WHen I start debugging, I immediately run ino

"The URI you submitted has disallowed characters."

Does anyone have any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

撩人痒 2024-07-16 18:11:43

(假设您使用的是最新版本的 CodeIgniter (CI),即 1.7.0)

CI 对于 URL 中允许使用的字符非常严格。 您可以修改用于过滤 URL 的正则表达式。

在 system/config/config.php 的第 126 行中,

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

这一行上面的注释几乎解释了这一切,以及使用什么哨兵值来覆盖此过滤器并允许所有字符(即完全关闭过滤)。

顺便说一句,我发现 CI 的限制性太大(它不允许 GET 请求,并希望所有交互都通过 POST 进行。我觉得这绝对疯狂,就像倒洗澡水时把婴儿一起倒掉一样。显然,我不是唯一一个认为 CI 限制过多的人,Kohana Project 是 CI + 优化的一个分支,即纯 php5 支持(全部 OO),(CI 仍然兼容 PHP4,代价是无法采取PHP5 OO 功能的优势)

相比 CI,我更喜欢 Kohana,YMMV

http://kohanaphp.com/home

(Assuming you are using the latest version of CodeIgniter (CI) which is 1.7.0)

CI is pretty strict about what characters it allows in URLs. You can modify the regex that is used to filter URLs.

In system/config/config.php on line 126 is

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

The comment above this line pretty much explains it all, and what sentinel value to use to over-ride this filter and permit all characters (i.e. turn off filtering completely).

On a side note, I found CI to be way too restrictive (for one it doesnt allow for GET requests and wants all interactions to happen via POST. I find this absolutely crazy and is akin to throwing the baby out with the bath water. Apparently, I am not the only one who thinks that CI is overly restrictive, the Kohana Project is a fork of CI + optimizations, namely pure php5 support (all OO), (CI is still PHP4 compatible at the expense of not being able to take advantage of PHP5 OO capabilities).

I prefer Kohana over CI, YMMV

http://kohanaphp.com/home

她如夕阳 2024-07-16 18:11:43

如果使用旧版本的 CodeIgniter 和 PHP 5.4,您必须修改

if ( ! preg_match("|^[" . preg_quote($this->config->item('permitted_uri_chars')) . "]+$|i", $str)) {

if (FALSE === preg_match("|^[" . preg_quote($this->config->item('permitted_uri_chars')) . "]+$|i", $str)) {

/system/libraries/URI.php

If using an old version of CodeIgniter and PHP 5.4 you have to modify

if ( ! preg_match("|^[" . preg_quote($this->config->item('permitted_uri_chars')) . "]+$|i", $str)) {

into

if (FALSE === preg_match("|^[" . preg_quote($this->config->item('permitted_uri_chars')) . "]+$|i", $str)) {

in /system/libraries/URI.php

诗笺 2024-07-16 18:11:43

在表达式引擎中,您会在 /admin/expressionengine/config/config.php 中找到此

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

更改,

$config['permitted_uri_chars'] = ''; 

但在执行此操作之前请阅读行注释。

或者不要使用任何基于 CI 的东西。

in Expression engine you'll find this in /admin/expressionengine/config/config.php

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

change to

$config['permitted_uri_chars'] = ''; 

but read the line comment before you do this.

Or don't use anything CI based.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文