mirror of
https://github.com/unraid/webgui.git
synced 2026-04-26 04:11:12 -05:00
Remove double quote and forward slashes from description.
This commit is contained in:
@@ -32,7 +32,7 @@ _(Server name)_:
|
||||
:id_server_name_help:
|
||||
|
||||
_(Description)_:
|
||||
: <input type="text" name="COMMENT" value="<?=htmlspecialchars(_var($var,'COMMENT'))?>" <?=$disabled?>>
|
||||
: <input type="text" name="COMMENT" id="COMMENT" value="<?=htmlspecialchars(_var($var,'COMMENT'))?>" <?=$disabled?>>
|
||||
|
||||
:id_description_help:
|
||||
|
||||
@@ -44,10 +44,12 @@ _(Model)_:
|
||||
|
||||
: <input type="submit" name="changeNames" value="_(Apply)_" disabled><input type="button" value="_(Done)_" onclick="done()"><?if ($disabled):?>*_(Array must be **Stopped** to change)_*<?endif;?>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$("#NAME").keypress(function(event) {
|
||||
return event.key.match(/[A-Za-z0-9\-\.]/)!==null;
|
||||
});
|
||||
|
||||
$("#NAME").on("input change", function() {
|
||||
if ($(this).val().match(/<?=$name_regex;?>/) === null) {
|
||||
$('#name_warning').fadeIn('fast');
|
||||
@@ -55,4 +57,10 @@ $("#NAME").on("input change", function() {
|
||||
$('#name_warning').fadeOut('fast');
|
||||
}
|
||||
});
|
||||
|
||||
/* Sanitize the COMMENT field on form submission */
|
||||
document.forms['NameSettings'].addEventListener('submit', function(event) {
|
||||
var commentField = document.getElementById('COMMENT');
|
||||
commentField.value = commentField.value.replace(/["\\]/g, '');
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user