Skip to content

Commit 51ba3df

Browse files
cezar97techknowlogick
authored andcommitted
Add noreferrer to rel='noopener` for <a> tags (#4328)
1 parent 4b654ad commit 51ba3df

File tree

17 files changed

+59
-59
lines changed

17 files changed

+59
-59
lines changed

models/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ var (
781781
// DescriptionHTML does special handles to description and return HTML string.
782782
func (repo *Repository) DescriptionHTML() template.HTML {
783783
sanitize := func(s string) string {
784-
return fmt.Sprintf(`<a href="%[1]s" target="_blank" rel="noopener">%[1]s</a>`, s)
784+
return fmt.Sprintf(`<a href="%[1]s" target="_blank" rel="noopener noreferrer">%[1]s</a>`, s)
785785
}
786786
return template.HTML(descPattern.ReplaceAllStringFunc(markup.Sanitize(repo.Description), sanitize))
787787
}

options/locale/locale_en-US.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ cancel = Cancel
7575
[install]
7676
install = Installation
7777
title = Initial Configuration
78-
docker_helper = If you run Gitea inside Docker, please read the <a target="_blank" rel="noopener" href="%s">documentation</a> before changing any settings.
78+
docker_helper = If you run Gitea inside Docker, please read the <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> before changing any settings.
7979
requite_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB.
8080
db_title = Database Settings
8181
db_type = Database Type
@@ -495,7 +495,7 @@ visibility = Visibility
495495
visiblity_helper = Make Repository Private
496496
visiblity_helper_forced = Your site administrator forces new repositories to be private.
497497
visiblity_fork_helper = (Changing this will affect all forks.)
498-
clone_helper = Need help cloning? Visit <a target="_blank" rel="noopener" href="%s">Help</a>.
498+
clone_helper = Need help cloning? Visit <a target="_blank" rel="noopener noreferrer" href="%s">Help</a>.
499499
fork_repo = Fork Repository
500500
fork_from = Fork From
501501
fork_visiblity_helper = The visibility of a forked repository cannot be changed.
@@ -613,7 +613,7 @@ editor.directory_is_a_file = Directory name '%s' is already used as a filename i
613613
editor.file_is_a_symlink = '%s' is a symbolic link. Symbolic links cannot be edited in the web editor
614614
editor.filename_is_a_directory = Filename '%s' is already used as a directory name in this repository.
615615
editor.file_editing_no_longer_exists = The file being edited, '%s', no longer exists in this repository.
616-
editor.file_changed_while_editing = The file contents have changed since you started editing. <a target="_blank" rel="noopener" href="%s">Click here</a> to see them or <strong>Commit Changes again</strong> to overwrite them.
616+
editor.file_changed_while_editing = The file contents have changed since you started editing. <a target="_blank" rel="noopener noreferrer" href="%s">Click here</a> to see them or <strong>Commit Changes again</strong> to overwrite them.
617617
editor.file_already_exists = A file named '%s' already exists in this repository.
618618
editor.no_changes_to_show = There are no changes to show.
619619
editor.fail_to_update_file = Failed to update/create file '%s' with error: %v
@@ -994,7 +994,7 @@ settings.search_user_placeholder = Search user…
994994
settings.org_not_allowed_to_be_collaborator = Organizations cannot be added as a collaborator.
995995
settings.user_is_org_member = The user is an organization member who cannot be added as a collaborator.
996996
settings.add_webhook = Add Webhook
997-
settings.hooks_desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Read more in the <a target="_blank" rel="noopener" href="%s">webhooks guide</a>.
997+
settings.hooks_desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Read more in the <a target="_blank" rel="noopener noreferrer" href="%s">webhooks guide</a>.
998998
settings.webhook_deletion = Remove Webhook
999999
settings.webhook_deletion_desc = Removing a webhook deletes its settings and delivery history. Continue?
10001000
settings.webhook_deletion_success = The webhook has been removed.
@@ -1011,7 +1011,7 @@ settings.githook_edit_desc = If the hook is inactive, sample content will be pre
10111011
settings.githook_name = Hook Name
10121012
settings.githook_content = Hook Content
10131013
settings.update_githook = Update Hook
1014-
settings.add_webhook_desc = Gitea will send <code>POST</code> requests with a specified content type to the target URL. Read more in the <a target="_blank" rel="noopener" href="%s">webhooks guide</a>.
1014+
settings.add_webhook_desc = Gitea will send <code>POST</code> requests with a specified content type to the target URL. Read more in the <a target="_blank" rel="noopener noreferrer" href="%s">webhooks guide</a>.
10151015
settings.payload_url = Target URL
10161016
settings.content_type = POST Content Type
10171017
settings.secret = Secret

templates/base/footer.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818
<div class="ui right links">
1919
{{if .ShowFooterBranding}}
20-
<a target="_blank" rel="noopener" href="https://github.com/go-gitea/gitea"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a>
20+
<a target="_blank" rel="noopener noreferrer" href="https://github.com/go-gitea/gitea"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a>
2121
{{end}}
2222
<div class="ui language bottom floating slide up dropdown link item">
2323
<i class="world icon"></i>
@@ -30,7 +30,7 @@
3030
</div>
3131
<a href="{{AppSubUrl}}/vendor/librejs.html" data-jslicense="1">JavaScript licenses</a>
3232
{{if .EnableSwaggerEndpoint}}<a href="{{AppSubUrl}}/api/swagger">API</a>{{end}}
33-
<a target="_blank" rel="noopener" href="https://gitea.io">{{.i18n.Tr "website"}}</a>
33+
<a target="_blank" rel="noopener noreferrer" href="https://gitea.io">{{.i18n.Tr "website"}}</a>
3434
{{if (or .ShowFooterVersion .PageIsAdmin)}}<span class="version">{{GoVer}}</span>{{end}}
3535
</div>
3636
</div>

0 commit comments

Comments
 (0)