There was an error while loading. Please reload this page.
1 parent 214b93e commit e7c7b64Copy full SHA for e7c7b64
1 file changed
components/AuthorCard.tsx
@@ -32,7 +32,15 @@ function AuthorCard({ authorData }) {
32
// Generate social media links dynamically
33
const socialLinks = authorData.socials
34
? Object.entries(authorData.socials)
35
- .filter(([platform, url]) => url) // Remove empty links
+ .filter(([, url]) => {
36
+ if (typeof url !== "string") return false;
37
+ try {
38
+ const parsed = new URL(url.trim());
39
+ return parsed.protocol === "https:" && parsed.username === "" && parsed.password === "";
40
+ } catch {
41
+ return false;
42
+ }
43
+ })
44
.map(([platform, url]) => ({
45
href: url,
46
ariaLabel: `Visit ${authorData.name}'s ${platform} page`,
0 commit comments