Page MenuHomeSoftware Heritage

D5969.id21573.diff
No OneTemporary

D5969.id21573.diff

diff --git a/assets/src/bundles/admin/origin-save.js b/assets/src/bundles/admin/origin-save.js
--- a/assets/src/bundles/admin/origin-save.js
+++ b/assets/src/bundles/admin/origin-save.js
@@ -92,7 +92,8 @@
} else {
html += sanitizedURL;
}
- html += `&nbsp;<a href="${sanitizedURL}"><i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>`;
+ html += `&nbsp;<a href="${sanitizedURL}" target="_blank" rel="noopener noreferrer">` +
+ '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
return html;
}
return data;
diff --git a/assets/src/bundles/save/index.js b/assets/src/bundles/save/index.js
--- a/assets/src/bundles/save/index.js
+++ b/assets/src/bundles/save/index.js
@@ -194,7 +194,8 @@
} else {
html += sanitizedURL;
}
- html += `&nbsp;<a href="${sanitizedURL}"><i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>`;
+ html += `&nbsp;<a href="${sanitizedURL}" target="_blank" rel="noopener noreferrer">` +
+ '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
return html;
}
return data;
diff --git a/cypress/integration/origin-save.spec.js b/cypress/integration/origin-save.spec.js
--- a/cypress/integration/origin-save.spec.js
+++ b/cypress/integration/origin-save.spec.js
@@ -277,7 +277,7 @@
} else {
html += this.originSaveJSON.data[i].origin_url;
}
- html += `&nbsp;<a href="${this.originSaveJSON.data[i].origin_url}">`;
+ html += `&nbsp;<a href="${this.originSaveJSON.data[i].origin_url}" target="_blank" rel="noopener noreferrer">`;
html += '<i class="mdi mdi-open-in-new" aria-hidden="true"></i></a>';
assert.equal($(cells[2]).html(), html);
assert.equal($(cells[3]).text(), this.originSaveJSON.data[i].save_request_status);
diff --git a/swh/web/templates/includes/snapshot-context.html b/swh/web/templates/includes/snapshot-context.html
--- a/swh/web/templates/includes/snapshot-context.html
+++ b/swh/web/templates/includes/snapshot-context.html
@@ -14,7 +14,8 @@
{{ snapshot_context.origin_info.url }}
</a>
{% if snapshot_context.origin_info.url|slice:"0:4" == "http" %}
- <a href="{{ snapshot_context.origin_info.url }}" title="Go to origin">
+ <a href="{{ snapshot_context.origin_info.url }}"
+ target="_blank" rel="noopener noreferrer" title="Go to origin">
<i class="mdi mdi-open-in-new" aria-hidden="true"></i>
</a>
{% endif %}

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 11:45 AM (11 w, 15 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3220665

Event Timeline