From d6d3ef2f621ec871a2f20eaa35ea419dd1033837 Mon Sep 17 00:00:00 2001 From: hudazaan Date: Thu, 16 Oct 2025 22:49:22 +0530 Subject: [PATCH 1/2] fix: accept Google Drive links in profile picture validation --- src/sections/Community/Web-based-from/index.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/sections/Community/Web-based-from/index.js b/src/sections/Community/Web-based-from/index.js index dfb400bae7f9c..51c6f5e242198 100644 --- a/src/sections/Community/Web-based-from/index.js +++ b/src/sections/Community/Web-based-from/index.js @@ -27,11 +27,23 @@ const validatePictureUrl = (value) => { } else { try { new URL(value); + + const isGoogleDrive = value.includes('drive.google.com'); + if (isGoogleDrive) { + const isFileLink = value.includes('/file/d/'); + const isViewLink = value.includes('/view'); + const isDownloadLink = value.includes('/uc?'); + + if (!isFileLink || (!isViewLink && !isDownloadLink)) { + error = "Please provide a direct Google Drive file link."; + } + } else { const allowedImageExtensions = ["jpg", "jpeg", "png", "webp", "svg", "gif"]; const extension = value.split(".").pop().toLowerCase(); if (!allowedImageExtensions.includes(extension)) { error = "URL must point to an image file (jpg, jpeg, png, svg, webp or gif)."; } + } } catch (_) { error = "Please enter a URL to an image file."; } @@ -184,7 +196,7 @@ const WebBasedForm = () => { {errors.picture && touched.picture &&
{errors.picture}
} -

Please provide a link to your profile photo. Profile photos are used for community member profiles of longstanding community members.

+

Please provide a link to your profile photo. Profile photos are used for community member profiles of longstanding community members. For Google Drive links, please ensure you're using direct image links that end with .jpg, .png, etc.