Skip to content

Commit

Permalink
fix: issue with version switcher and DOMPurify.sanitize (#3450)
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Franzke <[email protected]>
  • Loading branch information
nmerget and mfranzke authored Nov 12, 2024
1 parent 65a8c7f commit 62bd7e0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { useRouter } from 'next/router';
import { sanitize } from 'dompurify';
import DOMPurify from 'dompurify';
import { DBSelect } from '../../../../output/react/src';
import { type BranchGroup, type GithubResponse } from './data';

Expand Down Expand Up @@ -108,7 +108,7 @@ const VersionSwitcher = () => {
(branch.split('.').length === 3 && branch.startsWith('v')) ||
branch === 'latest';
window.location.replace(
sanitize(
DOMPurify.sanitize(
`https://${owner}.github.io/${repo}${
isTag ? '/version' : '/review'
}/${branch}${lastPath}`
Expand Down

0 comments on commit 62bd7e0

Please sign in to comment.