Skip to content

Commit

Permalink
fix regex #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevad committed Jul 26, 2017
1 parent 766ddd9 commit 70a5c17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CronTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ public function __construct($command, $action = null, array $params = array())
);
}

if (!preg_match('/^[a-z0-9]+$/i', $command)) {
if (!preg_match('/^[a-z0-9\-_]+$/i', $command)) {
throw new InvalidArgumentException(
'Specified command value is not valid. Valid examples: myConsole, import'
'Specified command value is not valid. Valid examples: myConsole, import, product-feed'
);
}

if (!empty($action) && !preg_match('/^[a-z0-9\-_]+$/i', $action)) {
throw new InvalidArgumentException(
'Specified action value is not valid. Valid examples: run, index, start'
'Specified action value is not valid. Valid examples: run, index, force-start'
);
}

Expand Down

0 comments on commit 70a5c17

Please sign in to comment.