主题: file_manager.js BUG |
作者: dahong, 发布日期: 2010-10-02 21:37:12, 浏览数: 4048 |
你好。反馈一个file_manager.js的问题,就是fileManageJson不支持/index.php?x=&y=这种格式,只支持不带参数的格式,反复了测试了才在LOG中找到了
Time:2010-10-02 21:09:21 | Request_Method:GET | Ip:127.0.0.1 | URI:/stcms4.0/index.php?m=editor_upload&a=file_manage?path=&order=NAME&1286024961578 | Reffer:http://localhost/stcms4.0/plugins/editor/plugins/file_manager/file_manager.html?id=page&ver=3.5.1%20(2010-07-18)&id=page&ver=3.5.1%20%282010-07-18%29 | UserAgent:Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.6 (KHTML, like Gecko) Chrome/7.0.503.0 Safari/534.6 于是打算修复此问题,在file_manager.js 中有: var httpRequest = function (param, func) { KE.util.showLoadingPage(id); var req = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); var url = fileManagerJson; url += param; url += (url.match(/\?/) ? "&" : "?") + (new Date()).getTime() req.open('GET', url, true); req.onreadystatechange = function () { if (req.readyState == 4) { if(req.status == 200) { func(req.responseText); KE.util.pluginLang('file_manager', document); KE.util.hideLoadingPage(id); } } }; req.send(null); }; var reloadPage = function (path, order, func) { httpRequest('?path=' + path + '&order=' + order, func); }; 可见是没有验证url是否带有参数,所以,应该改成: var httpRequest = function (param, func) { KE.util.showLoadingPage(id); var req = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); var url = fileManagerJson; url += (url.match(/\?/) ? '&'+ param : '?' + param); url += (url.match(/\?/) ? "&" : "?") + (new Date()).getTime() req.open('GET', url, true); req.onreadystatechange = function () { if (req.readyState == 4) { if(req.status == 200) { func(req.responseText); KE.util.pluginLang('file_manager', document); KE.util.hideLoadingPage(id); } } }; req.send(null); }; var reloadPage = function (path, order, func) { httpRequest('path=' + path + '&order=' + order, func); }; 后便可以正常使用。 |