mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-27 16:01:14 +00:00
1. Add check for invalid characters in menu_class plugin.
2. Optimization for help language list process
This commit is contained in:
@@ -1 +1 @@
|
||||
20211201 20:08:18
|
||||
20211203 17:44:10
|
1
Plugson/www/helplist
Normal file
1
Plugson/www/helplist
Normal file
@@ -0,0 +1 @@
|
||||
de_DEen_USfr_FRhr_HRid_IDja_JPpt_PTsr_CYsr_SRtr_TRzh_CN
|
@@ -723,7 +723,7 @@
|
||||
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b id="plugson_build_date">20211201 20:08:18</b>
|
||||
<b id="plugson_build_date">20211203 17:44:10</b>
|
||||
</div>
|
||||
<strong><a href="https://www.ventoy.net" target="_blank">https://www.ventoy.net</a></strong>
|
||||
</footer>
|
||||
|
@@ -169,11 +169,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (extra.indexOf("\"") >= 0) {
|
||||
Message.error(g_current_language === 'en' ? "Class can not contains double quotes." : "Class 不能包含双引号。");
|
||||
return;
|
||||
}
|
||||
|
||||
callVtoy({
|
||||
method : 'class_add',
|
||||
index: current_tab_index,
|
||||
@@ -188,6 +183,11 @@
|
||||
}
|
||||
|
||||
function OnAddKeyClass(key, value) {
|
||||
if (!ventoy_check_file_name_char(key)) {
|
||||
Message.error(g_current_language === 'en' ? "As part of file name, key can not include invalid characters!" : "作为文件名的一部分,key 中不能包含特殊的符号!");
|
||||
return;
|
||||
}
|
||||
|
||||
AddClassEntry(key, 0, 1, value);
|
||||
}
|
||||
|
||||
|
@@ -1,3 +1,16 @@
|
||||
function ventoy_check_file_name_char(path) {
|
||||
for (var i = 0; i < path.length; i++) {
|
||||
var cc = path[i];
|
||||
if (cc === '/' || cc === '\\' || cc === '*' || cc === '?' || cc === '"' || cc === '<' || cc === '>' || cc === '|')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
(function(factory) {
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define(["jquery", "../jquery.validate"], factory);
|
||||
@@ -62,6 +75,14 @@
|
||||
|
||||
return true;
|
||||
}, 'Can not contain double quotes');
|
||||
|
||||
$.validator.addMethod('filenamepart', function(value, element, params) {
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ventoy_check_file_name_char(value);
|
||||
}, 'Invalid characters');
|
||||
|
||||
|
||||
$.validator.addMethod('printascii', function(value, element, params) {
|
||||
|
@@ -896,6 +896,7 @@ function VtoyCommonChangeLanguage(newlang) {
|
||||
utfmaxlen: $.validator.format("The string exceeds the maximum supported length"),
|
||||
start_slash: $.validator.format("Must start with /"),
|
||||
noquotes: $.validator.format("Can not include double quotes"),
|
||||
filenamepart:$.validator.format("As part of file name, can not include invalid characters"),
|
||||
printascii: $.validator.format("Can not include non-ascii characters.")
|
||||
});
|
||||
|
||||
@@ -941,6 +942,7 @@ function VtoyCommonChangeLanguage(newlang) {
|
||||
utfmaxlen: $.validator.format("超过最大长度"),
|
||||
start_slash: $.validator.format("必须以反斜杠 / 开头"),
|
||||
noquotes: $.validator.format("不能包含双引号"),
|
||||
filenamepart:$.validator.format("作为文件名的一部分,不能包含特殊的符号"),
|
||||
printascii: $.validator.format("不能包含中文或其他非 ascii 字符。")
|
||||
});
|
||||
|
||||
@@ -1102,7 +1104,8 @@ var g_set_key_validator = $("#SetKeyForm").validate({
|
||||
},
|
||||
SetKeyValue : {
|
||||
required: true,
|
||||
utfmaxlen: true
|
||||
utfmaxlen: true,
|
||||
filenamepart: true
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user