Simplify slack channel regexp and allow private (no # prefix) channels and direct messages (@ prefix) (#6699)

This commit is contained in:
Steffen 2019-02-09 00:41:54 +01:00 committed by snipe
parent 4fd469e07b
commit 3530603797

View file

@ -65,7 +65,7 @@ class Setting extends Model
'default_currency' => 'required',
'locale' => 'required',
'slack_endpoint' => 'url|required_with:slack_channel|nullable',
'slack_channel' => 'regex:/(?<!\w)#\w+/|required_with:slack_endpoint|nullable',
'slack_channel' => 'regex:/^[\#\@]?\w+/|required_with:slack_endpoint|nullable',
'slack_botname' => 'string|nullable',
'labels_per_page' => 'numeric',
'labels_width' => 'numeric',