Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 a1855d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/RemotePushDialog.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit a1855d8

Please sign in to comment.