Skip to content

Commit e7c7b64

Browse files
Render only HTTPS author social links.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 214b93e commit e7c7b64

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

components/AuthorCard.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,15 @@ function AuthorCard({ authorData }) {
3232
// Generate social media links dynamically
3333
const socialLinks = authorData.socials
3434
? Object.entries(authorData.socials)
35-
.filter(([platform, url]) => url) // Remove empty links
35+
.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+
})
3644
.map(([platform, url]) => ({
3745
href: url,
3846
ariaLabel: `Visit ${authorData.name}'s ${platform} page`,

0 commit comments

Comments
 (0)