Skip to content

Commit

Permalink
Validate sequence range
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Feb 8, 2016
1 parent 8baba43 commit 3072f6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/NgramCorpus.php
Expand Up @@ -143,6 +143,9 @@ protected function _validate() {
if (!$this->getTable()->sequenceTypeExists($this->sequence_type)) {
$this->addError('Sequence Type', 'Invalid sequence type');
}
if ($this->sequence_range && !preg_match('/^[^\s-]+-[^\s-]+$/', $this->sequence_range)) {
$this->addError('Sequence Range', 'Invalid sequence range');
}
}

protected function beforeSave($args)
Expand Down

0 comments on commit 3072f6c

Please sign in to comment.