mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-02-07 03:58:28 -06:00
dbhub: Don't allow invalid file or branch names in push dialog
See issue #1136.
This commit is contained in:
@@ -54,12 +54,16 @@ void RemotePushDialog::checkInput()
|
||||
|
||||
if(ui->editName->text().trimmed().isEmpty())
|
||||
valid = false;
|
||||
if(!QRegExp("^[a-z,A-Z,0-9,\\.,\\-,\\_,\\(,\\),\\+,\\ ]+$").exactMatch(ui->editName->text()))
|
||||
valid = false;
|
||||
|
||||
if(ui->editCommitMessage->toPlainText().size() > 1024)
|
||||
valid = false;
|
||||
|
||||
if(ui->comboBranch->currentText().size() < 1 || ui->comboBranch->currentText().size() > 32)
|
||||
valid = false;
|
||||
if(!QRegExp("^[a-z,A-Z,0-9,\\^,\\.,\\-,\\_,\\/,\\(,\\),\\:,\\&,\\ )]+$").exactMatch(ui->comboBranch->currentText()))
|
||||
valid = false;
|
||||
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user