Merge pull request #596 from Squidly271/patch-19

Disallow characters incompatible with FAT32 in share names
This commit is contained in:
tom mortensen
2020-02-19 12:25:06 -08:00
committed by GitHub
+6 -2
View File
@@ -93,11 +93,11 @@ foreach ($rows as $row) echo $row;
<input type="hidden" name="shareNameOrig" value="<?=htmlspecialchars($share['nameOrig'])?>">
Share name:
: <input type="text" name="shareName" maxlength="40" value="<?=htmlspecialchars($name)?>" pattern="^[^/\\]*$" title="Slashes are not allowed">
: <input type="text" name="shareName" maxlength="40" value="<?=htmlspecialchars($name)?>">
> The share name can be up to 40 characters, and is case-sensitive with these restrictions:
>
> * cannot contain a double-quote character (")
> * cannot contain a double-quote character (") or the following characters: / \ * < > |
> * cannot be one of the reserved share names: flash, cache, cach2, .., disk1, disk2, ..
>
> We highly recommend to make your life easier and avoid special characters.
@@ -321,6 +321,10 @@ function prepareEdit(form) {
swal('Invalid share name', 'Do not use reserved names', 'error');
return false;
}
if (share.match('[:\\\/*<>|"]')) {
swal('Invalid Characters', 'You cannot use the following within share names : \\ / * < > | "','error');
return false;
}
form.shareName.value = share;
// Adjust minimum free space value to selected unit
var unit = 'KB,MB,GB,TB,PB';