Skip to content

Commit

Permalink
update regex in CronTask
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevad committed Jul 26, 2017
1 parent e7142a3 commit 766ddd9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CronTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* How to add and run task see CronService class description.
*
* @author Vadym Stepanov <[email protected]>
* @date 18.01.2016
* @date 26.07.2017
*/
class CronTask
{
Expand Down Expand Up @@ -132,7 +132,7 @@ public function __construct($command, $action = null, array $params = array())
);
}

if (!empty($action) && !preg_match('/^[a-z0-9]+$/i', $action)) {
if (!empty($action) && !preg_match('/^[a-z0-9\-_]+$/i', $action)) {
throw new InvalidArgumentException(
'Specified action value is not valid. Valid examples: run, index, start'
);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ $task->daily()->hour(18);
Author
-------------

Copyright (c) 2016 by Stevad.
Copyright (c) 2017 by Stevad.

0 comments on commit 766ddd9

Please sign in to comment.