Skip to content

Commit 624a217

Browse files
committed
Sanitise hexagon board IDs
Fixes a small bug where invalid hexagon IDs could be passed to HexagonGroupsButton. This wasn't affecting the live site, but could cause an error on staging.
1 parent c465c5a commit 624a217

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/components/elements/cards/BoardCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const BoardCard = ({user, board, boardView, assignees, toggleAssignModal,
141141
// Decides whether we show the "Assign/Unassign" button, along with other "Set Assignments"-specific stuff
142142
const isSetAssignments = isDefined(toggleAssignModal) && isDefined(assignees);
143143

144-
const hexagonId = `board-hex-${board.id}`;
144+
const hexagonId = (`board-hex-${board.id}`).replace(/[^a-z0-9-]+/gi, '');
145145
const boardLink = isSetAssignments ? `/assignment/${board.id}` : `${PATHS.GAMEBOARD}#${board.id}`;
146146
const hasAssignedGroups = assignees && assignees.length > 0;
147147

0 commit comments

Comments
 (0)