Remove double quote and forward slashes from description.

This commit is contained in:
dlandon
2024-05-20 08:42:43 -05:00
parent dcb1e43d21
commit bdc9ef9782
+9 -1
View File
@@ -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)_:
&nbsp;
: <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>