Adds stricter validation for slack endpoints

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2021-12-06 11:40:24 -08:00
parent cae62fd4c7
commit ebdbc20740
5 changed files with 39 additions and 33 deletions
+2 -2
View File
@@ -54,9 +54,9 @@ class Setting extends Model
'admin_cc_email' => 'email|nullable',
'default_currency' => 'required',
'locale' => 'required',
'slack_endpoint' => 'url|required_with:slack_channel|nullable',
'slack_endpoint' => 'url|required_with:slack_channel|nullable|starts_with:https://hooks.slack.com',
'labels_per_page' => 'numeric',
'slack_channel' => 'regex:/^[\#\@]?\w+/|required_with:slack_endpoint|nullable',
'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable',
'slack_botname' => 'string|nullable',
'labels_width' => 'numeric',
'labels_height' => 'numeric',