aboutsummaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Move some functions to service layer (#26969)Lunny Xiao2023-09-0816-762/+652
|
* Add a new column schedule_id for action_run to track (#26975)Lunny Xiao2023-09-083-1/+19
| | | | | | | | Fix #26971 And the UI now will display it's scheduled but not triggered by a push. <img width="954" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365">
* move repository deletion to service layer (#26948)Lunny Xiao2023-09-0814-437/+21
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor dashboard/feed.tmpl (#26956)CaiCandong2023-09-071-0/+9
| | | | - ~~Refactor `ActionType` to `models/activities/action_type.go`~~ - Replace the magic number in `feed.tmlp` with `InAction`
* Replace `util.SliceXxx` with `slices.Xxx` (#26958)CaiCandong2023-09-075-7/+12
|
* Artifacts retention and auto clean up (#26131)FuXiaoHei2023-09-063-10/+66
| | | | | | | | | | | | | | Currently, Artifact does not have an expiration and automatic cleanup mechanism, and this feature needs to be added. It contains the following key points: - [x] add global artifact retention days option in config file. Default value is 90 days. - [x] add cron task to clean up expired artifacts. It should run once a day. - [x] support custom retention period from `retention-days: 5` in `upload-artifact@v3`. - [x] artifacts link in actions view should be non-clickable text when expired.
* Refactor secrets modification logic (#26873)KN4CK3R2023-09-051-83/+23
| | | | - Share code between web and api - Add some tests
* Improve DeleteByID (#26904)Lunny Xiao2023-09-051-1/+1
|
* Fix wrong review requested number (#26784)Nanguan Lin2023-09-031-6/+15
| | | | | | | | | | Fix the wrong review requested number mentioned by #18808 . Fix #18808 Before: ![ksnip_20230829-140750](https://github.com/go-gitea/gitea/assets/70063547/0af2055b-6f16-4699-a944-c7186831d7f9) After: ![ksnip_20230829-141817](https://github.com/go-gitea/gitea/assets/70063547/16633264-20ba-45e3-bfbb-a495ed76a45b)
* Check blocklist for emails when adding them to account (#26812)techknowlogick2023-08-301-1/+12
|
* Use `Set[Type]` instead of `map[Type]bool/struct{}`. (#26804)KN4CK3R2023-08-301-3/+3
|
* Fix verifyCommits error when push a new branch (#26664)CaiCandong2023-08-303-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | > ### Description > If a new branch is pushed, and the repository has a rule that would require signed commits for the new branch, the commit is rejected with a 500 error regardless of whether it's signed. > > When pushing a new branch, the "old" commit is the empty ID (0000000000000000000000000000000000000000). verifyCommits has no provision for this and passes an invalid commit range to git rev-list. Prior to 1.19 this wasn't an issue because only pre-existing individual branches could be protected. > > I was able to reproduce with [try.gitea.io/CraigTest/test](https://try.gitea.io/CraigTest/test), which is set up with a blanket rule to require commits on all branches. Fix #25565 Very thanks to @Craig-Holmquist-NTI for reporting the bug and suggesting an valid solution! --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* feat(API): add route and implementation for creating/updating repository ↵Bo-Yi Wu2023-08-291-0/+28
| | | | | | | | | | | | | | | | | | secret (#26766) spec: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret - Add a new route for creating or updating a secret value in a repository - Create a new file `routers/api/v1/repo/action.go` with the implementation of the `CreateOrUpdateSecret` function - Update the Swagger documentation for the `updateRepoSecret` operation in the `v1_json.tmpl` template file --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Replace deprecated `elliptic.Marshal` (#26800)Chongyi Zheng2023-08-291-2/+5
| | | | | | | | | | | | | In PR #26786, the Go version for golangci-lint is bumped to 1.21. This causes the following error: ``` models/migrations/v1_16/v210.go:132:23: SA1019: elliptic.Marshal has been deprecated since Go 1.21: for ECDH, use the crypto/ecdh package. This function returns an encoding equivalent to that of PublicKey.Bytes in crypto/ecdh. (staticcheck) PublicKey: elliptic.Marshal(elliptic.P256(), parsed.PubKey.X, parsed.PubKey.Y), ``` The change now uses [func (*PublicKey) ECDH](https://pkg.go.dev/crypto/ecdsa#PublicKey.ECDH), which is added in Go 1.20.
* Move `modules/mirror` to `services` (#26737)Chongyi Zheng2023-08-271-1/+1
| | | | | To solve the cyclic imports in a better way Closes #20261
* add Upload URL to release API (#26663)Earl Warren2023-08-241-0/+5
| | | | | | | | | | | | - Resolves https://codeberg.org/forgejo/forgejo/issues/580 - Return a `upload_field` to any release API response, which points to the API URL for uploading new assets. - Adds unit test. - Adds integration testing to verify URL is returned correctly and that upload endpoint actually works --------- Co-authored-by: Gusted <postmaster@gusted.xyz>
* Add `member`, `collaborator`, `contributor`, and `first-time contributor` ↵yp053272023-08-242-27/+33
| | | | | | | | | | | | | | | | | roles and tooltips (#26658) GitHub like role descriptor ![image](https://github.com/go-gitea/gitea/assets/18380374/ceaed92c-6749-47b3-89e8-0e0e7ae65321) ![image](https://github.com/go-gitea/gitea/assets/18380374/8193ec34-cbf0-47f9-b0de-10dbddd66970) ![image](https://github.com/go-gitea/gitea/assets/18380374/56c7ed85-6177-425e-9f2f-926e99770782) --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* chore(actions): support cron schedule task (#26655)Lunny Xiao2023-08-247-0/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace #22751 1. only support the default branch in the repository setting. 2. autoload schedule data from the schedule table after starting the service. 3. support specific syntax like `@yearly`, `@monthly`, `@weekly`, `@daily`, `@hourly` ## How to use See the [GitHub Actions document](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule) for getting more detailed information. ```yaml on: schedule: - cron: '30 5 * * 1,3' - cron: '30 5 * * 2,4' jobs: test_schedule: runs-on: ubuntu-latest steps: - name: Not on Monday or Wednesday if: github.event.schedule != '30 5 * * 1,3' run: echo "This step will be skipped on Monday and Wednesday" - name: Every time run: echo "This step will always run" ``` Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com> --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* feat(API): update and delete secret for managing organization secrets (#26660)Bo-Yi Wu2023-08-241-0/+67
| | | | | | | | | | | | | | | | | | - Add `UpdateSecret` function to modify org or user repo secret - Add `DeleteSecret` function to delete secret from an organization - Add `UpdateSecretOption` struct for updating secret options - Add `UpdateOrgSecret` function to update a secret in an organization - Add `DeleteOrgSecret` function to delete a secret in an organization GitHub API 1. Update Org Secret: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret 2. Delete Org Secret: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28#delete-an-organization-secret --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* Fix archived unix time when archiving the label (#26681)puni98692023-08-231-3/+4
| | | | | Small Fix :-`ArchivedUnix` column changed only change the date when it is newly archived. Co-authored-by: Giteabot <teabot@gitea.io>
* Fix counting and filtering on the dashboard page for issues (#26657)Jason Song2023-08-231-13/+23
| | | | | | | | | | | | | | | | | | This PR has multiple parts, and I didn't split them because it's not easy to test them separately since they are all about the dashboard page for issues. 1. Support counting issues via indexer to fix #26361 2. Fix repo selection so it also fixes #26653 3. Keep keywords in filter links. The first two are regressions of #26012. After: https://github.com/go-gitea/gitea/assets/9418365/71dfea7e-d9e2-42b6-851a-cc081435c946 Thanks to @CaiCandong for helping with some tests.
* [Refactor] getIssueStatsChunk to move inner function into own one (#26671)65432023-08-221-48/+49
| | | | | | | move inner **countSession** of **getIssueStatsChunk** into it's own function for reuse --- *Sponsored by Kithara Software GmbH*
* Add optimistic lock to ActionRun table (#26563)Jason Song2023-08-215-25/+53
| | | | | | | | | Should fix #26559. How xorm works: https://xorm.io/docs/chapter-06/1.lock/ --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add link to job details and tooltip to commit status in repo list in ↵yp053272023-08-211-0/+6
| | | | | | | | | | | dashboard (#26326) Tooltip: ![image](https://github.com/go-gitea/gitea/assets/18380374/237cb545-7844-424b-b995-1008eaaaedec) Link to the target job: ![image](https://github.com/go-gitea/gitea/assets/18380374/0c11a97f-6517-47f2-8773-f381488c084e)
* Ignore the trailing slashes when comparing oauth2 redirect_uri (#26597)wxiaoguang2023-08-212-2/+23
| | | Fix #26526
* Fix project filter bugs (#26490)CaiCandong2023-08-152-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | related: #26012 ### Bugs 1. missing project filter on the issue page. https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15 3. incorrect SQL condition: some issue does not belong to a project but exists on the project_issue table. https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233 ### Before: ![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f) ### After: ![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d) --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Add API route to list org secrets (#26485)Bo-Yi Wu2023-08-151-0/+5
| | | | | | | | | | | | | | | | | | | - Add a new function `CountOrgSecrets` in the file `models/secret/secret.go` - Add a new file `modules/structs/secret.go` - Add a new function `ListActionsSecrets` in the file `routers/api/v1/api.go` - Add a new file `routers/api/v1/org/action.go` - Add a new function `listActionsSecrets` in the file `routers/api/v1/org/action.go` go-sdk: https://gitea.com/gitea/go-sdk/pulls/629 --------- Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Giteabot <teabot@gitea.io>
* add disable workflow feature (#26413)a10121127962023-08-143-1/+81
| | | | | | | | | | | | | | | | As title, that's simmilar with github. ![image](https://github.com/go-gitea/gitea/assets/25342410/9e8b2444-63e0-4e87-80da-730c1e4d09d6) ![image](https://github.com/go-gitea/gitea/assets/25342410/6c3a3345-3ba7-48c9-9acd-3e621632491b) --------- Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Jason Song <i@wolfogre.com>
* Allow to archive labels (#26478)puni98692023-08-145-6/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ## Archived labels This adds the structure to allow for archived labels. Archived labels are, just like closed milestones or projects, a medium to hide information without deleting it. It is especially useful if there are outdated labels that should no longer be used without deleting the label entirely. ## Changes 1. UI and API have been equipped with the support to mark a label as archived 2. The time when a label has been archived will be stored in the DB ## Outsourced for the future There's no special handling for archived labels at the moment. This will be done in the future. ## Screenshots ![image](https://github.com/go-gitea/gitea/assets/80308335/208f95cd-42e4-4ed7-9a1f-cd2050a645d4) ![image](https://github.com/go-gitea/gitea/assets/80308335/746428e0-40bb-45b3-b992-85602feb371d) Part of https://github.com/go-gitea/gitea/issues/25237 --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix NuGet search endpoints (#25613)KN4CK3R2023-08-143-5/+91
| | | | | | | | | Fixes #25564 Fixes #23191 - Api v2 search endpoint should return only the latest version matching the query - Api v3 search endpoint should return `take` packages not package versions
* Rename `Sync2` -> `Sync` (#26479)delvh2023-08-13118-180/+180
| | | | | | | | | The xorm `Sync2` has already been deprecated in favor of `Sync`, so let's do the same inside the Gitea codebase. Command used to replace everything: ```sh for i in $(ag Sync2 --files-with-matches); do vim $i -c ':%sno/Sync2/Sync/g' -c ':wq'; done ```
* Fix stderr usages (#26477)wxiaoguang2023-08-131-3/+1
|
* Refactor project templates (#26448)Denys Konovalov2023-08-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR refactors a bunch of projects-related code, mostly the templates. The following things were done: - rename boards to columns in frontend code - use the new `ctx.Locale.Tr` method - cleanup template, remove useless newlines, classes, comments - merge org-/user and repo level project template together - move "new column" button into project toolbar - move issue card (shared by projects and pinned issues) to shared template, remove useless duplicated styles - add search function to projects (to make the layout more similar to milestones list where it is inherited from :laughing:) - maybe more changes I forgot I've done :laughing: Closes #24893 After: ![Bildschirmfoto vom 2023-08-10 23-02-00](https://github.com/go-gitea/gitea/assets/47871822/cab61456-1d23-4373-8163-e567f1b3b5f9) ![Bildschirmfoto vom 2023-08-10 23-02-26](https://github.com/go-gitea/gitea/assets/47871822/94b55d60-5572-48eb-8111-538a52d8bcc6) ![Bildschirmfoto vom 2023-08-10 23-02-46](https://github.com/go-gitea/gitea/assets/47871822/a0358f4b-4e05-4194-a7bc-6e0ecba5a9b6) --------- Co-authored-by: silverwind <me@silverwind.io>
* Count only visible repos on profile (#25928)JakobDev2023-08-112-102/+132
| | | Fixes #25914
* Always show usernames in reaction tooltips (#26444)Panagiotis "Ivory" Vasilopoulos2023-08-102-2/+2
| | | | | | | | | | | | Even if GetDisplayName() is normally preferred elsewhere, this change provides more consistency, as usernames are also always being shown when participating in a conversation taking place in an issue or a pull request. This change makes conversations easier to follow, as you would not have to have a mental association between someone's username and someone's real name in order to follow what is happening. This behavior matches GitHub's. Optimally, both the username and the full name (if applicable) could be shown, but such an effort is a much bigger task that needs to be thought out well.
* Add transaction when creating pull request created dirty data (#26259)Lunny Xiao2023-08-103-15/+14
| | | | | | | | | | | | Fix #26129 Replace #26258 This PR will introduce a transaction on creating pull request so that if some step failed, it will rollback totally. And there will be no dirty pull request exist. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Pre-register OAuth2 applications for git credential helpers (#26291)Denys Konovalov2023-08-091-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | This PR is an extended implementation of #25189 and builds upon the proposal by @hickford in #25653, utilizing some ideas proposed internally by @wxiaoguang. Mainly, this PR consists of a mechanism to pre-register OAuth2 applications on startup, which can be enabled or disabled by modifying the `[oauth2].DEFAULT_APPLICATIONS` parameter in app.ini. The OAuth2 applications registered this way are being marked as "locked" and neither be deleted nor edited over UI to prevent confusing/unexpected behavior. Instead, they're being removed if no longer enabled in config. ![grafik](https://github.com/go-gitea/gitea/assets/47871822/81a78b1c-4b68-40a7-9e99-c272ebb8f62e) The implemented mechanism can also be used to pre-register other OAuth2 applications in the future, if wanted. Co-authored-by: hickford <mirth.hickford@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> --------- Co-authored-by: M Hickford <mirth.hickford@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix generated source URL on rendered files (#26364)Earl Warren2023-08-081-0/+12
| | | | | | | | | | | | | | | - The permalink and 'Reference in New issue' URL of an renderable file (those where you can see the source and a rendered version of it, such as markdown) doesn't contain `?display=source`. This leads the issue that the URL doesn't have any effect, as by default the rendered version is shown and thus not the source. - Add `?display=source` to the permalink URL and to 'Reference in New Issue' if it's renderable file. - Add integration testing. Refs: https://codeberg.org/forgejo/forgejo/pulls/1088 Co-authored-by: Gusted <postmaster@gusted.xyz> Co-authored-by: Giteabot <teabot@gitea.io>
* Use more `IssueList` instead of `[]*Issue` (#26369)Lunny Xiao2023-08-073-6/+6
|
* Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect ↵wxiaoguang2023-08-072-8/+58
| | | | | | IssueIndex (#26279) Close #26277 Fix #26285
* Fix log typo in task.go (#26337)cassiozareck2023-08-051-1/+1
| | | Signed-off-by: cassiozareck <cassiomilczareck@gmail.com>
* Fix bug with sqlite load read (#26305)Lunny Xiao2023-08-054-10/+25
| | | Possible fix #26280
* Delete `issue_service.CreateComment` (#26298)caicandong2023-08-041-1/+9
| | | | | | | I noticed that `issue_service.CreateComment` adds transaction operations on `issues_model.CreateComment`, we can merge the two functions and we can avoid calling each other's methods in the `services` layer. Co-authored-by: Giteabot <teabot@gitea.io>
* Use yellow if an approved review is stale (#26312)sebastian-sauer2023-08-041-0/+3
| | | | | | | | | | | | | | By using a different color it's clear that the review isn't pointing to the latest commit. **Screenshots:** Not stale review: ![image](https://github.com/go-gitea/gitea/assets/1135157/2901ad69-e0d8-4041-b760-277d02dafd45) Stale review: ![image](https://github.com/go-gitea/gitea/assets/1135157/500b306e-a994-42d4-a2fd-1174774ba5ee) fixes #26306
* Fix the topic validation rule and suport dots (#26286)wxiaoguang2023-08-032-1/+3
| | | | | 1. Allow leading and trailing spaces by user input, these spaces have already been trimmed at backend 2. Allow using dots in the topic
* Allow editing push mirrors after creation (#26151)puni98692023-08-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to edit the sync interval for existing push mirrors. Currently, there is no way to modify the interval once the mirror is created. <details> <summary>Screenshots</summary> ## Before <img width="936" alt="Screenshot 2023-07-26 at 9 31 21 AM" src="https://github.com/go-gitea/gitea/assets/80308335/35b8a40c-4320-474c-a866-1dea0f1fa0de"> ## After <img width="945" alt="Screenshot 2023-07-26 at 9 44 40 AM" src="https://github.com/go-gitea/gitea/assets/80308335/ee12e12f-0f68-4feb-90eb-33366f5997d3"> ### On hover <img width="247" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2f32de45-bd50-4150-9623-3be2ef3ea7f8"> <img width="237" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/49f4ab4d-ccff-4489-80ce-a9788a73c3bb"> <img width="245" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/165fc888-9d48-438a-b730-d4beb12122af"> ### Edit modal <img width="905" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/2a7ca24b-4f36-4e0e-9799-39f2ecc46413"> ### Only valid times are allowed <img width="728" alt="Screenshot 2023-07-26 at 9 50 01 AM" src="https://github.com/go-gitea/gitea/assets/80308335/ced6d330-c235-4e29-8f17-28daddcf1444"> <img width="853" alt="image" src="https://github.com/go-gitea/gitea/assets/80308335/8636f62a-70d1-4684-a3e8-b205adc03580"> </details> Fixes #21295 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Some fixes of the prompt of new branches (#26257)Zettat1232023-08-011-2/+2
| | | | | | | | | Related to #26239 This PR makes some fixes: - do not show the prompt for mirror repos and repos with pull request units disabled - use `commit_time` instead of `updated_unix`, as `commit_time` is the real time when the branch was pushed
* Refactor and enhance issue indexer to support both searching, filtering and ↵Jason Song2023-07-317-78/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | paging (#26012) Fix #24662. Replace #24822 and #25708 (although it has been merged) ## Background In the past, Gitea supported issue searching with a keyword and conditions in a less efficient way. It worked by searching for issues with the keyword and obtaining limited IDs (as it is heavy to get all) on the indexer (bleve/elasticsearch/meilisearch), and then querying with conditions on the database to find a subset of the found IDs. This is why the results could be incomplete. To solve this issue, we need to store all fields that could be used as conditions in the indexer and support both keyword and additional conditions when searching with the indexer. ## Major changes - Redefine `IndexerData` to include all fields that could be used as filter conditions. - Refactor `Search(ctx context.Context, kw string, repoIDs []int64, limit, start int, state string)` to `Search(ctx context.Context, options *SearchOptions)`, so it supports more conditions now. - Change the data type stored in `issueIndexerQueue`. Use `IndexerMetadata` instead of `IndexerData` in case the data has been updated while it is in the queue. This also reduces the storage size of the queue. - Enhance searching with Bleve/Elasticsearch/Meilisearch, make them fully support `SearchOptions`. Also, update the data versions. - Keep most logic of database indexer, but remove `issues.SearchIssueIDsByKeyword` in `models` to avoid confusion where is the entry point to search issues. - Start a Meilisearch instance to test it in unit tests. - Add unit tests with almost full coverage to test Bleve/Elasticsearch/Meilisearch indexer. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix pull request check list is limited (#26179)caicandong2023-07-311-3/+3
| | | | | | | | | | | | In the original implementation, we can only get the first 30 records of the commit status (the default paging size), if the commit status is more than 30, it will lead to the bug #25990. I made the following two changes. - On the page, use the ` db.ListOptions{ListAll: true}` parameter instead of `db.ListOptions{}` - The `GetLatestCommitStatus` function makes a determination as to whether or not a pager is being used. fixed #25990
* Fix API leaking Usermail if not logged in (#25097)JakobDev2023-07-311-1/+6
| | | | | | | | | The API should only return the real Mail of a User, if the caller is logged in. The check do to this don't work. This PR fixes this. This not really a security issue, but can lead to Spam. --------- Co-authored-by: silverwind <me@silverwind.io>