Zend Framework 奇怪错误控制器无效,请求中包含部分 javascript 源
我网站上的日志中有非常奇怪的错误。该网站基于 Zend Framework,我经常遇到以下或类似的错误:
2011-10-16T03:02:57+02:00 ERR (3): Error requesting: /js/min/,e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find( from ip: 24.132.216.36
Invalid controller specified (js)
#0 /application/include/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /application/include/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /application/Bootstrap.php(271): Zend_Application_Bootstrap_Bootstrap->run()
#3 /application/include/Zend/Application.php(366): Bootstrap->run()
#4 /public/index.php(11): Zend_Application->run()
#5 {main}
现在我知道根本没有控制器 /js。有趣的是,请求中是 jQuery UI 脚本的一部分。我不知道哪些浏览器发出了这些请求以及来自哪个站点。 jQueryUI 中的脚本是缩小文件 jQuery UI 对话框 1.8.16 的一部分,但有时错误是缩小脚本的不同部分。
我试图获取 jQuery UI Dialog 1.8.16 的源代码,我发现这是脚本中的代码:
uiDialogTitle = $('<span></span>')
.addClass('ui-dialog-title')
.attr('id', titleId)
.html(title)
.prependTo(uiDialogTitlebar);
//handling of deprecated beforeclose (vs beforeClose) option
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
//TODO: remove in 1.9pre
if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
options.beforeClose = options.beforeclose;
}
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
这些错误始终仅在 jQueryUI 缩小脚本中显示。我还有许多其他脚本,但有时只有 jQueryUI 源出现在 get 请求中。有人有类似的错误并且可以提供帮助吗?
I have very strange errors in my logs on my website. The site is based on Zend Framework and I frequently has this or similar errors:
2011-10-16T03:02:57+02:00 ERR (3): Error requesting: /js/min/,e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find( from ip: 24.132.216.36
Invalid controller specified (js)
#0 /application/include/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /application/include/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /application/Bootstrap.php(271): Zend_Application_Bootstrap_Bootstrap->run()
#3 /application/include/Zend/Application.php(366): Bootstrap->run()
#4 /public/index.php(11): Zend_Application->run()
#5 {main}
Now I know that there is no controller /js at all. What is funny that in the request is the part of the jQuery UI script. I have no information about what browser did those requests and from which site. The script in the jQueryUI is part from minified file jQuery UI Dialog 1.8.16 but sometimes the errors are which diffrent parts of the minified script.
I tried to get to the source of jQuery UI Dialog 1.8.16 and i found that this is the code from the script:
uiDialogTitle = $('<span></span>')
.addClass('ui-dialog-title')
.attr('id', titleId)
.html(title)
.prependTo(uiDialogTitlebar);
//handling of deprecated beforeclose (vs beforeClose) option
//Ticket #4669 http://dev.jqueryui.com/ticket/4669
//TODO: remove in 1.9pre
if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
options.beforeClose = options.beforeclose;
}
uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
Those errors are always show only with the jQueryUI minified scripts. I have also many other scripts but only jQueryUI source sometimes appear in the get request. Does anybody have similar errors and can help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我看来,对 js 代码的请求正在通过 Zend Framework 引导程序重写?在 .htaccess 文件中,您可能想要向 Zend Framework 应用程序添加一个不特定 url 模式的条目。我通常这样做:
It sounds to me like the request for your js code is being rewritten through your Zend Framework bootstrap? In your .htaccess file you may want to add an entry to not specific url patterns to the Zend Framework application. Here's generally what I do:
我遇到了同样的问题,htacces 更改帮助了我,但后来我发现真正的原因是 js 文件为空。添加js文件中的一些代码后,问题得到解决,根本不需要更改htaccess
I had same problem and htacces changes helped me but later I found that really reason was that js file was empty. after addins some code in js file problem solved and there was not needed to change htaccess at all