1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-23 09:04:26 +00:00
gitea/templates/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
..
branch Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
diff Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
editor Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
graph Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
issue Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
migrate Migrating wiki don't require token, so we should move it out of the require form (#17645) 2021-11-16 14:17:21 +08:00
projects Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
pulls Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
release Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
settings Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
wiki Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
activity.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
blame.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
branch_dropdown.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
clone_buttons.tmpl Add copy button to markdown code blocks (#17638) 2021-11-16 16:16:05 +08:00
commit_page.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
commit_status.tmpl Show dropdown with all statuses for commit (#13977) 2020-12-20 11:13:12 +08:00
commit_statuses.tmpl Show dropdown with all statuses for commit (#13977) 2020-12-20 11:13:12 +08:00
commits_list_small.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
commits_list.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
commits_table.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
commits.tmpl Add compare tag dropdown to releases page (#15695) 2021-05-03 13:27:48 -04:00
create.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
empty.tmpl Fix default push instructions on empty repos (#16302) 2021-06-30 20:40:51 +02:00
forks.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
graph.tmpl Re-separate the color translation strings (#17390) 2021-10-21 23:51:03 +02:00
header.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
home.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
icon.tmpl Do not display org avatar near icon for internal repos (#13957) 2020-12-13 16:51:15 -05:00
search.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
shabox_badge.tmpl Fix avatar template error (#13833) 2020-12-03 23:12:59 +00:00
sub_menu.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
upload.tmpl Add attachments for PR reviews (#16075) 2021-06-14 21:12:33 -04:00
user_cards.tmpl Direct avatar rendering (#13649) 2020-12-03 19:46:11 +01:00
view_file.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
view_list.tmpl Multiple Escaping Improvements (#17551) 2021-11-16 18:18:25 +00:00
watchers.tmpl Add class to page content to unify top margin (#13766) 2020-11-30 23:00:14 -05:00