1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-18 09:15:49 +00:00
gitea/routers/web/repo
zeripath bbffcc3aec
Multiple Escaping Improvements (#17551)
There are multiple places where Gitea does not properly escape URLs that it is building and there are multiple places where it builds urls when there is already a simpler function available to use this.
    
This is an extensive PR attempting to fix these issues.

1. The first commit in this PR looks through all href, src and links in the Gitea codebase and has attempted to catch all the places where there is potentially incomplete escaping.
2. Whilst doing this we will prefer to use functions that create URLs over recreating them by hand.
3. All uses of strings should be directly escaped - even if they are not currently expected to contain escaping characters. The main benefit to doing this will be that we can consider relaxing the constraints on user names and reponames in future. 
4. The next commit looks at escaping in the wiki and re-considers the urls that are used there. Using the improved escaping here wiki files containing '/'. (This implementation will currently still place all of the wiki files the root directory of the repo but this would not be difficult to change.)
5. The title generation in feeds is now properly escaped.
6. EscapePound is no longer needed - urls should be PathEscaped / QueryEscaped as necessary but then re-escaped with Escape when creating html with locales Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-11-16 18:18:25 +00:00
..
activity.go Move unit into models/unit/ (#17576) 2021-11-09 20:57:58 +01:00
attachment.go Add repo_id for attachment (#16958) 2021-09-08 17:19:30 +02:00
blame.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
branch.go Move unit into models/unit/ (#17576) 2021-11-09 20:57:58 +01:00
commit.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
compare.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
download.go Download lfs in git and web workflow from minio/s3 directly (#16731) 2021-08-21 20:22:06 +02:00
editor_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
editor.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
http_test.go Fix http path bug (#16117) 2021-06-09 14:53:12 +02:00
http.go Move EmailAddress & UserRedirect into models/user/ (#17607) 2021-11-11 15:03:30 +08:00
issue_content_history.go Move unit into models/unit/ (#17576) 2021-11-09 20:57:58 +01:00
issue_dependency.go Rename context.Query to context.Form (#16562) 2021-07-29 03:42:15 +02:00
issue_label_test.go Decouple unit test, remove intermediate unittestbridge package (#17662) 2021-11-16 16:53:21 +08:00
issue_label.go Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
issue_lock.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
issue_stopwatch.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
issue_test.go Hide label comments if labels were added and removed immediately (#17455) 2021-11-04 22:51:30 +08:00
issue_timetrack.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
issue_watch.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
issue.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
lfs.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
main_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
middlewares.go Rename ctx.Form() to ctx.FormString() and move code into own file (#16571) 2021-08-11 02:31:13 +02:00
migrate.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
milestone.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
projects_test.go Decouple unit test code from business code (#17623) 2021-11-12 22:36:47 +08:00
projects.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
pull_review.go Rename ctx.Form() to ctx.FormString() and move code into own file (#16571) 2021-08-11 02:31:13 +02:00
pull.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
release_test.go Decouple unit test, remove intermediate unittestbridge package (#17662) 2021-11-16 16:53:21 +08:00
release.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
repo.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
search.go Related refactors to ctx.FormX functions (#16567) 2021-08-11 18:08:52 +03:00
setting_protected_branch.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
setting.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
settings_test.go Decouple unit test, remove intermediate unittestbridge package (#17662) 2021-11-16 16:53:21 +08:00
tag.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
topic.go Related refactors to ctx.FormX functions (#16567) 2021-08-11 18:08:52 +03:00
view.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
webhook.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
wiki_test.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
wiki.go Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00