[PR #4786] [MERGED] Slack webhook channel name cannot be empty or just contain an hashtag #17496

Closed
opened 2025-11-02 13:40:31 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/4786
Author: @adelowo
Created: 8/24/2018
Status: Merged
Merged: 9/10/2018
Merged by: @techknowlogick

Base: masterHead: slack_webhook_cannot_contain_just_hashtag


📝 Commits (10+)

  • d1ce06b validate slack channel name to make sure it cannot be empty and contain just an #
  • 59af9bb Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag
  • e70e41d rearrange imports
  • 576cdb5 Merge branch 'slack_webhook_cannot_contain_just_hashtag' of github.com:adelowo/gitea into slack_webhook_cannot_contain_just_hashtag
  • f767bc3 add comment
  • 9e4d13a rearrange imports
  • 1c61885 add missing return statement
  • 968d1f2 fix imports spacing
  • 8052858 Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag
  • 0ba75e4 Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag

📊 Changes

6 files changed (+69 additions, -5 deletions)

View changed files

📝 modules/auth/repo_form.go (+7 -0)
📝 options/locale/locale_en-US.ini (+1 -0)
📝 routers/api/v1/utils/hook.go (+11 -3)
📝 routers/repo/webhook.go (+14 -2)
📝 routers/utils/utils.go (+19 -0)
📝 routers/utils/utils_test.go (+17 -0)

📄 Description

  • Don't allow an empty string to be used as a slack channel name.
  • Don't allow just # to be used as a slack channel name.. Slack doesn't allow this itself in the app
  • Don't allow channel name to contain spaces e.g . channel

There can also be another added check which I have skipped... channel names cannot contain spaces in between or punctuations e.g ch nae or cd##jndd.. Should that be added too or this is good enough ?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/4786 **Author:** [@adelowo](https://github.com/adelowo) **Created:** 8/24/2018 **Status:** ✅ Merged **Merged:** 9/10/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `slack_webhook_cannot_contain_just_hashtag` --- ### 📝 Commits (10+) - [`d1ce06b`](https://github.com/go-gitea/gitea/commit/d1ce06b22ec5ec3ecbfb8cbf9e8cee7b307ea83c) validate slack channel name to make sure it cannot be empty and contain just an # - [`59af9bb`](https://github.com/go-gitea/gitea/commit/59af9bbe04726c665239c1fb7fd35fcf5ac4bcff) Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag - [`e70e41d`](https://github.com/go-gitea/gitea/commit/e70e41d1616502b5e8980b8d56a122e1aeb52671) rearrange imports - [`576cdb5`](https://github.com/go-gitea/gitea/commit/576cdb5201897139d64725faec164b45788d7b47) Merge branch 'slack_webhook_cannot_contain_just_hashtag' of github.com:adelowo/gitea into slack_webhook_cannot_contain_just_hashtag - [`f767bc3`](https://github.com/go-gitea/gitea/commit/f767bc3abea7fe3f37e7c9437240ff26379f92a1) add comment - [`9e4d13a`](https://github.com/go-gitea/gitea/commit/9e4d13a527f5ccd235c18e866dd3b13dafda4833) rearrange imports - [`1c61885`](https://github.com/go-gitea/gitea/commit/1c61885246e6fb4356250a1c3bcb8a763ff7fdc5) add missing return statement - [`968d1f2`](https://github.com/go-gitea/gitea/commit/968d1f2274dc11ab73f0e670d68a0a56a950f238) fix imports spacing - [`8052858`](https://github.com/go-gitea/gitea/commit/805285893139d87c41bd2145c4c5a583a0df41c1) Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag - [`0ba75e4`](https://github.com/go-gitea/gitea/commit/0ba75e4a3f57f651d198b15b2abafe7816753fd3) Merge branch 'master' into slack_webhook_cannot_contain_just_hashtag ### 📊 Changes **6 files changed** (+69 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `modules/auth/repo_form.go` (+7 -0) 📝 `options/locale/locale_en-US.ini` (+1 -0) 📝 `routers/api/v1/utils/hook.go` (+11 -3) 📝 `routers/repo/webhook.go` (+14 -2) 📝 `routers/utils/utils.go` (+19 -0) 📝 `routers/utils/utils_test.go` (+17 -0) </details> ### 📄 Description - [x] Don't allow an empty string to be used as a slack channel name. - [x] Don't allow just # to be used as a slack channel name.. Slack doesn't allow this itself in the app - [x] Don't allow channel name to contain spaces e.g ` . channel ` > There can also be another added check which I have skipped... channel names cannot contain spaces in between or punctuations e.g `ch nae` or `cd##jndd`.. Should that be added too or this is good enough ? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 13:40:31 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17496