mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 08:21: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,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) {
|
||||
|
Reference in New Issue
Block a user