Permalink
Browse files

dbhub: Don't allow invalid file or branch names in push dialog

See issue #1136.
  • Loading branch information...
MKleusberg committed Oct 5, 2017
1 parent 5de8f73 commit a1855d8f7525a1afa91a70256e6c892557dbb198
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/RemotePushDialog.cpp
@@ -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);
}

0 comments on commit a1855d8

Please sign in to comment.