diff options
author | Alexandre Flament <alex@al-f.net> | 2015-04-26 15:32:26 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2015-04-26 15:32:26 +0200 |
commit | 77b2fbb61edadab9319cfee429e9694840edec81 (patch) | |
tree | 73d382036e9acea587b251505a2d32714d26015e /searx/templates/oscar | |
parent | 952473d297b2f0131196086f5824ae48f32d2922 (diff) | |
download | searxng-77b2fbb61edadab9319cfee429e9694840edec81.tar.gz searxng-77b2fbb61edadab9319cfee429e9694840edec81.zip |
[enh] implements #264 : add rel="noreferrer" to external links
Diffstat (limited to 'searx/templates/oscar')
-rw-r--r-- | searx/templates/oscar/infobox.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/macros.html | 6 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/code.html | 2 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/images.html | 6 | ||||
-rw-r--r-- | searx/templates/oscar/result_templates/videos.html | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/searx/templates/oscar/infobox.html b/searx/templates/oscar/infobox.html index 1aa2e5c11..2abdbf0ec 100644 --- a/searx/templates/oscar/infobox.html +++ b/searx/templates/oscar/infobox.html @@ -20,7 +20,7 @@ {% if infobox.urls %} <div class="infobox_part"> {% for url in infobox.urls %} - <p class="btn btn-default btn-xs"><a href="{{ url.url }}">{{ url.title }}</a></p> + <p class="btn btn-default btn-xs"><a href="{{ url.url }}" rel="noreferrer">{{ url.title }}</a></p> {% endfor %} </div> {% endif %} diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index feb9ba942..5866c132c 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -11,15 +11,15 @@ <!-- Draw result header -->
{% macro result_header(result, favicons) -%}
- <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
+ <h4 class="result_header">{% if result.engine~".png" in favicons %}{{ draw_favicon(result.engine) }} {% endif %}<a href="{{ result.url }}" rel="noreferrer">{{ result.title|safe }}</a></h4>
{%- endmacro %}
<!-- Draw result sub header -->
{% macro result_sub_header(result) -%}
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
- <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
+ <small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}" rel="noreferrer">{{ icon('link') }} {{ _('cached') }}</a></small>
{% if result.magnetlink %}<small> • <a href="{{ result.magnetlink }}" class="magnetlink">{{ icon('magnet') }} {{ _('magnet link') }}</a></small>{% endif %}
- {% if result.torrentfile %}<small> • <a href="{{ result.torrentfile }}" class="torrentfile">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
+ {% if result.torrentfile %}<small> • <a href="{{ result.torrentfile }}" class="torrentfile" rel="noreferrer">{{ icon('download-alt') }} {{ _('torrent file') }}</a></small>{% endif %}
{%- endmacro %}
<!-- Draw result footer -->
diff --git a/searx/templates/oscar/result_templates/code.html b/searx/templates/oscar/result_templates/code.html index 6890c7851..582a2149c 100644 --- a/searx/templates/oscar/result_templates/code.html +++ b/searx/templates/oscar/result_templates/code.html @@ -5,7 +5,7 @@ {% if result.content %}<p class="result-content">{{ result.content|safe }}</p>{% endif %}
-{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository|safe }}">{{ result.repository }}</a></p>{% endif %}
+{% if result.repository %}<p class="result-content">{{ icon('file') }} <a href="{{ result.repository|safe }}" rel="noreferrer">{{ result.repository }}</a></p>{% endif %}
<div dir="ltr">
{{ result.codelines|code_highlighter(result.code_language)|safe }}
diff --git a/searx/templates/oscar/result_templates/images.html b/searx/templates/oscar/result_templates/images.html index 3f39ca6da..1bfff0a1a 100644 --- a/searx/templates/oscar/result_templates/images.html +++ b/searx/templates/oscar/result_templates/images.html @@ -1,6 +1,6 @@ {% from 'oscar/macros.html' import draw_favicon %}
-<a href="{{ result.img_src }}" data-toggle="modal" data-target="#modal-{{ index }}">
+<a href="{{ result.img_src }}" rel="noreferrer" data-toggle="modal" data-target="#modal-{{ index }}">
<img src="{% if result.thumbnail_src %}{{ image_proxify(result.thumbnail_src) }}{% else %}{{ image_proxify(result.img_src) }}{% endif %}" alt="{{ result.title|striptags }}" title="{{ result.title|striptags }}" class="img-thumbnail">
</a>
@@ -20,8 +20,8 @@ <span class="label label-default pull-right">{{ result.engine }}</span>
<p class="text-muted pull-left">{{ result.pretty_url }}</p>
<div class="clearfix"></div>
- <a href="{{ result.img_src }}" class="btn btn-default">{{ _('Get image') }}</a>
- <a href="{{ result.url }}" class="btn btn-default">{{ _('View source') }}</a>
+ <a href="{{ result.img_src }}" rel="noreferrer" class="btn btn-default">{{ _('Get image') }}</a>
+ <a href="{{ result.url }}" rel="noreferrer" class="btn btn-default">{{ _('View source') }}</a>
</div>
</div>
</div>
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html index ddf2894ac..af4841453 100644 --- a/searx/templates/oscar/result_templates/videos.html +++ b/searx/templates/oscar/result_templates/videos.html @@ -15,7 +15,7 @@ <div class="container-fluid">
<div class="row">
- <a href="{{ result.url }}"><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
+ <a href="{{ result.url }}" rel="noreferrer"><img class="thumbnail col-xs-6 col-sm-4 col-md-4 result-content" src="{{ image_proxify(result.thumbnail) }}" alt="{{ result.title|striptags }} {{ result.engine }}" /></a>
{% if result.content %}<p class="col-xs-12 col-sm-8 col-md-8 result-content">{{ result.content|safe }}</p>{% endif %}
</div>
</div>
|