javascript - elFinder connector.php -> path in Internet Explorer -


i setting path dynamically in connector.php , works should in browsers apart internet explorer. here connector.php code:

function access($attr, $path, $data, $volume) {     return strpos(basename($path), '.') === 0       // if file/folder begins '.' (dot)         ? !($attr == 'read' || $attr == 'write')    // set read+write false, other (locked+hidden) set true         :  null;                                    // else elfinder decide }   // documentation 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(); 

basically happening if using browser (other ie) root directory correctly set $_get['mypath'], if in ie root directory set /files/ (the directory 1 level 1 needed) , result user can see folders should not accessing.

any ideas why happening?

p.s. theory have maybe ie javascript engine sending incorrect mypath variable?

elfinder code below:

<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> 

and actual source of page looks this:

<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> 

p.s.s > have confirmed ie doesn't send mypath variable.

does has ideas?

update: 09/02/16

today after further investigation found out strange behaviour of script:

if it's browser (except ie) $_get['mypath'] works should, in ie $_get['mypath'] not set, but, if ie $_post['mypath'] set instead of $_get['mypath'], but, in other browsers $_post['mypath'] not set.

i avoid checking if browser ie family use $_post , if other $_get.

does has suggestions?

answer:

$().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');             }); 

if force requesttype post post in browsers, dont't have worry checking if browser posts or gets.

$().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');             }); 

if force requesttype post post in browsers, dont't have worry checking if browser posts or gets.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -