From a626633c2e2db9e7d9b7968d8d47e8867d1520a1 Mon Sep 17 00:00:00 2001 From: Peter Morgan Date: Fri, 20 Dec 2019 11:42:25 -0700 Subject: [PATCH] Added Regular Expression check for user.blog value --- public/js/profileGen.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/js/profileGen.js b/public/js/profileGen.js index e8119a4..f9cf82a 100644 --- a/public/js/profileGen.js +++ b/public/js/profileGen.js @@ -8,6 +8,11 @@ function profileGen(username, container) window.location.href = "./GraphGenerator.html"; } parseOrgs(user.login).then( (orgsReturn) => { + if (user.blog) { + const rx = new RegExp("^(http|https)://", "i"); + const match = rx.test(user.blog); + user.blog = match ? user.blog : `http://${user.blog}`; + } let html = `