X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/3f09fb9a2389c5c212a70feada3206a3cb523c95..feea11e2bb2bc5f42ceca64255900e3917d87f98:/Plugson/www/static/js/vtoy.js diff --git a/Plugson/www/static/js/vtoy.js b/Plugson/www/static/js/vtoy.js index e3f59ac..ad82628 100644 --- a/Plugson/www/static/js/vtoy.js +++ b/Plugson/www/static/js/vtoy.js @@ -1,4 +1,13 @@ +function VtoyUTF16HexToAscii(hex) { + var str = ""; + for (var i = 0; i < hex.length; i += 4) { + str += String.fromCharCode(parseInt(hex.substring(i, i + 4), 16)); + } + + return str; +} + function ventoy_replace_slash(str) { var str1 = str.replace(/\\/g, '/'); var str2 = str1.replace(/\/\//g, '/'); @@ -24,6 +33,8 @@ function ventoy_get_ulen(str) { function ventoy_common_check_path(path) { + var curdir + if (path.indexOf('//') >= 0) { return false; } @@ -32,7 +43,12 @@ function ventoy_common_check_path(path) { return false; } - if (path.substr(0, g_current_dir.length) != g_current_dir) { + curdir = path.substr(0, g_current_dir.length); + if (curdir.match("^[a-z]:$")) { + curdir = curdir.toUpperCase(); + } + + if (curdir != g_current_dir) { return false; }