Javascript elFinder connector.php->;Internet Explorer中的路径
我在connector.php中动态设置path,它在除Internet Explorer之外的所有浏览器中都能正常工作。以下是我的connector.php代码:Javascript elFinder connector.php->;Internet Explorer中的路径,javascript,php,jquery,ajax,elfinder,Javascript,Php,Jquery,Ajax,Elfinder,我在connector.php中动态设置path,它在除Internet Explorer之外的所有浏览器中都能正常工作。以下是我的connector.php代码: function access($attr, $path, $data, $volume) { return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot) ? !($attr == 'read'
function access($attr, $path, $data, $volume) {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself
}
// Documentation for connector options:
// https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
$opts = array(
'debug' => true,
'roots' => array(
array(
'driver' => 'LocalFileSystem',
'path' => '../../pages/path/to/files/'.($_GET['mypath']).'/',
'URL' => '../../pages/path/to/files/'.($_GET['mypath']).'/',
'uploadDeny' => array('all'),
'uploadAllow' => array('image', 'text/plain'),
'uploadOrder' => array('deny', 'allow'),
'accessControl' => 'access'
)
)
);
// run elFinder
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
基本上,如果您使用任何浏览器(IE除外),您的根目录将正确设置为$\u GET['mypath']
,但如果您在IE中,则根目录将设置为/files/
(该目录仅比所需目录高一级)因此,用户可以看到他不应该访问的文件夹
你知道为什么会这样吗
另外,我唯一的理论是IE JavaScript引擎可能发送了错误的mypath
变量
elFinder代码如下:
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var elf = $('#elfinder').elfinder({
// lang: 'ru',
url : 'libraries/elFinder/connector.php',
rememberLastDir : false,
useBrowserHistory : false,
customData : {mypath : <?php echo json_encode($_GET['CIF']); ?>}
}).elfinder('instance');
});
</script>
如果您强制requestType
到post
,那么它在所有浏览器中都将始终是post
,因此您不必担心检查浏览器是否发布或获取。$()。就绪(函数(){
var elf=$('#elfinder').elfinder({
//郎:"如",,
url:'libraries/elFinder/connector.php',
requestType:'post',
记住lastdir:false,
useBrowserHistory:错误,
自定义数据:{mypath:}
}).elfinder(“实例”);
});
如果您强制requestType
到post
,那么它在所有浏览器中都将始终是post
,因此您不必担心检查浏览器是否发布或获取。$()。就绪(函数(){
var elf=$('#elfinder').elfinder({
//郎:"如",,
url:'libraries/elFinder/connector.php',
requestType:'post',
记住lastdir:false,
useBrowserHistory:错误,
自定义数据:{mypath:}
}).elfinder(“实例”);
});
如果您强制requestType
到post
,那么它在所有浏览器中都将始终是post
,因此您不必担心检查浏览器是否发布或获取
<script type="text/javascript" charset="utf-8">
$().ready(function() {
var elf = $('#elfinder').elfinder({
// lang: 'ru',
url : 'libraries/elFinder/connector.php',
rememberLastDir : false,
useBrowserHistory : false,
customData : {mypath : "mypath_folder"}
}).elfinder('instance');
});
</script>
$().ready(function() {
var elf = $('#elfinder').elfinder({
// lang: 'ru',
url : 'libraries/elFinder/connector.php',
requestType : 'post',
rememberLastDir : false,
useBrowserHistory : false,
customData : {mypath : <?php echo json_encode($_GET['CIF']); ?>}
}).elfinder('instance');
});
$().ready(function() {
var elf = $('#elfinder').elfinder({
// lang: 'ru',
url : 'libraries/elFinder/connector.php',
requestType : 'post',
rememberLastDir : false,
useBrowserHistory : false,
customData : {mypath : <?php echo json_encode($_GET['CIF']); ?>}
}).elfinder('instance');
});