mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
* Include nix development enviornment * Obfuscate contact email addresses in shop HTML and deanonymize via JavaScript This change addresses #1907: "hide contact e-mail address in source code of a shop". - Contact email addresses rendered in public-facing templates are now obfuscated in the HTML source (e.g., replacing "@" with "[at]" and "." with "[dot]"). - A new JavaScript file is included in the relevant templates to automatically rewrite and restore the email address for users after the page loads. - This approach helps protect email addresses from basic harvesting bots and reduces spam, while keeping them accessible and user-friendly for human visitors. - The obfuscation and deanonymization logic is only applied to web templates, not to emails sent via pretix. This implementation follows the recommendations discussed in #1907, using a standardized, maintainable approach that’s compatible with pretix's asset pipeline and template structure. * Undo nix development environment for merge into main * convert complete mailto-link to HTML entities * remove gitignore noise * Update .gitignore * fix gitignore noise * Update .gitignore --------- Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
7
src/pretix/static/pretixbase/js/deanonymize_email.js
Normal file
7
src/pretix/static/pretixbase/js/deanonymize_email.js
Normal file
@@ -0,0 +1,7 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('a[href^="mailto:"]').forEach(function(link) {
|
||||
// Replace [at] with @ and the [dot] with . in both the href and the displayed text (if needed)
|
||||
link.href = link.href.replace('[at]', '@').replace('[dot]', '.');
|
||||
link.textContent = link.textContent.replace('[at]', '@').replace('[dot]', '.');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user