From ef05cecaeb704b9d024be000ec844d6735f66c6a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 30 Oct 2025 21:37:41 +0000 Subject: [PATCH] make sure to only call init_contact_edit() on pageload if we have a fragment and are in /connections. this is to prevent fragment hijacking for other pages --- view/tpl/contact_edit_modal.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/view/tpl/contact_edit_modal.tpl b/view/tpl/contact_edit_modal.tpl index b9d9ead08..cdcf62367 100644 --- a/view/tpl/contact_edit_modal.tpl +++ b/view/tpl/contact_edit_modal.tpl @@ -30,17 +30,17 @@ let sub_section; $(document).ready(function() { - if (window.location.hash) { + let path_parts = window.location.pathname.split('/').filter(Boolean); + + if (window.location.hash && path_parts[0] === 'connections') { poi = window.location.hash.substr(1); init_contact_edit(poi); - } - window.onhashchange = function() { - if (window.location.hash) { + window.onhashchange = function() { poi = window.location.hash.substr(1); init_contact_edit(poi); - } - }; + }; + } }); $(document).on('click', '.contact-edit', function (e) {