diff options
author | Doge <[email protected]> | 2021-05-11 12:45:22 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-11 12:45:22 +0800 |
commit | 96814fc7dbd1c5c9770dc5563be2be0bc6422397 (patch) | |
tree | 54ea432479a0cdd1d1424476701336309a2185a7 /layout/_partial/header.ejs | |
parent | 0aa17cb5729bf39df1cfddcd5520fd9f238cadbd (diff) | |
download | chromate-96814fc7dbd1c5c9770dc5563be2be0bc6422397.tar.gz chromate-96814fc7dbd1c5c9770dc5563be2be0bc6422397.tar.bz2 chromate-96814fc7dbd1c5c9770dc5563be2be0bc6422397.zip |
Enhancement for non-self link security
Diffstat (limited to 'layout/_partial/header.ejs')
-rw-r--r-- | layout/_partial/header.ejs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index f9463f7..8ad3684 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -47,9 +47,12 @@ const favicon = mapping[1]; let outter = link.startsWith("https://") ? true : false; %> - <a class="icon" href="<%= link %>" target="<%= outter ? '_blank' : '_self' %>"> - <i class="<%= favicon %>"></i> - </a> + <% if (outter) { %> + <a class="icon" href="<%= link %>" target="_blank" rel="noopener noreferrer"> + <% } else { %> + <a class="icon" href="<%= link %>"> + <% } %> + <i class="<%= favicon %>"></i></a> <% } %> </ul> </p> |