From d2de5581b61ef0f161390fffad01b45b990f7f36 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 20:09:49 +0000 Subject: [PATCH] Fix copy link feature --- src/components/InteractiveIndex.tsx | 9 +++++++++ src/utils/security.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/InteractiveIndex.tsx b/src/components/InteractiveIndex.tsx index 4ecc3da..c9f3b9e 100644 --- a/src/components/InteractiveIndex.tsx +++ b/src/components/InteractiveIndex.tsx @@ -243,6 +243,15 @@ const allInteractives: Interactive[] = [ path: '/themes/games/craps-game', theme: 'Games', dateAdded: '2025-01-05' + }, + { + id: 'neighbor-sum-avoidance', + title: 'Neighbor Sum Avoidance', + description: 'Arrange numbers in a circle so that the sum of two neighbors is never divisible by 3, 5, or 7. An interactive graph theory puzzle!', + tags: ['graph-theory', 'puzzle', 'arrangement', 'divisibility', 'circle', 'mathematics'], + path: '/themes/discrete-math/graphs/neighbor-sum-avoidance', + theme: 'Discrete Math', + dateAdded: '2025-01-22' } ]; diff --git a/src/utils/security.ts b/src/utils/security.ts index a8bb895..7ec7d66 100644 --- a/src/utils/security.ts +++ b/src/utils/security.ts @@ -30,8 +30,8 @@ export const sanitizeUrl = (url: string): string => { try { const urlObj = new URL(url); - // Remove any potentially harmful query parameters - const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}`; + // Keep the full URL including pathname, search, and hash for proper routing + const cleanUrl = `${urlObj.protocol}//${urlObj.host}${urlObj.pathname}${urlObj.search}${urlObj.hash}`; return cleanUrl; } catch { return window.location.href;