3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 21:55:25 +02:00

Merge pull request from birarda/feat/validate-manual-backup-names

refuse to post manual content archive with invalid name
This commit is contained in:
Ryan Huffman 2018-02-22 14:29:43 -08:00 committed by GitHub
commit 12e881a5e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -386,6 +386,12 @@ $(document).ready(function(){
return false;
}
var MANUAL_ARCHIVE_NAME_REGEX = /^[a-zA-Z0-9\\-_ ]+$/;
if (!MANUAL_ARCHIVE_NAME_REGEX.test(inputValue)) {
swal.showInputError("Valid characters include A-z, 0-9, ' ', '_', and '-'.");
return false;
}
// post the provided archive name to ask the server to kick off a manual backup
$.ajax({
type: 'POST',