mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 00:11:15 +00:00
Auto remove the redundant trailing slash when set directory path on VentoyPlugson page.
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
function ventoy_replace_slash(str) {
|
||||
var str1 = str.replace(/\\/g, '/');
|
||||
var str2 = str1.replace(/\/\//g, '/');
|
||||
|
||||
if (str2 && str2.length > 0) {
|
||||
if (str2.substr(-1) === "/") {
|
||||
return str2.substr(0, str2.length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return str2;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user