Correctly link URLs to users/repos with dashes, dots or underscores#18890
Merged
6543 merged 4 commits intoFeb 25, 2022
Conversation
This commit adds tests for full URLs referencing repos names and user names containing a dash.
KN4CK3R
reviewed
Feb 25, 2022
729731f to
7dcccb8
Compare
Member
|
Sorry, mistake on my side. Inside |
Contributor
Author
|
Ah, no worries, my test case was wrong as well 😝 I'll revert it. |
7dcccb8 to
729731f
Compare
Contributor
Author
|
For the reference, here's my (now correct) simple test: https://go.dev/play/p/b4owdEOFUt3 |
noerw
approved these changes
Feb 25, 2022
silverwind
approved these changes
Feb 25, 2022
Member
|
🤖 |
Member
|
Please send backport |
silverwind
pushed a commit
to silverwind/gitea
that referenced
this pull request
Feb 26, 2022
…o-gitea#18890) * Add tests for references with dashes This commit adds tests for full URLs referencing repos names and user names containing a dash. * Extend regex to match URLs to repos/users with dashes
Member
|
Backport in #18908. |
Contributor
|
Why is this marked to skip changelog? |
Member
|
@Gusted The fix will be in v1.16.3's changelog, so it should not be in 1.17's changelog. |
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Feb 27, 2022
* giteaofficial/main: Fix page and missing return on unadopted repos API (go-gitea#18848) [skip ci] Updated licenses and gitignores Allow adminstrator teams members to see other teams (go-gitea#18918) Update nginx reverse proxy docs (go-gitea#18922) Don't treat BOM escape sequence as hidden character. (go-gitea#18909) Remove CodeMirror dependencies (go-gitea#18911) Uncapitalize errors (go-gitea#18915) Disable service worker by default (go-gitea#18914) Set is_empty in fixtures (go-gitea#18869) Don't update email for organisation (go-gitea#18905) Correctly link URLs to users/repos with dashes, dots or underscores (go-gitea#18890) Set is_private in fixtures. (go-gitea#18868) Fix team management UI (go-gitea#18886) Update JS dependencies (go-gitea#18898) Fix migration v210 (go-gitea#18892) migrations: add test for importing pull requests in gitea uploader (go-gitea#18752)
Chianina
pushed a commit
to Chianina/gitea
that referenced
this pull request
Mar 28, 2022
…o-gitea#18890) * Add tests for references with dashes This commit adds tests for full URLs referencing repos names and user names containing a dash. * Extend regex to match URLs to repos/users with dashes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the regex which is used to match full URLs in all texts to issues/PRs in repos hosted on Gitea so that user/repo names with dashes, dots or underscores (e.g.
http://localhost:5000/some-user/reponame) are matched correctly. The first commit introduces tests that fail, the second commit extends the regex from\w+to[\w_.-]+.I haven't found a central place where the user/repo name validation is performed. If there is a better way to do this please let me know. Thanks!
Closes #18888