Browse Source

Added Regular Expression check for user.blog value

pull/17/head
Peter Morgan 5 years ago
parent
commit
a626633c2e
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      public/js/profileGen.js

+ 5
- 0
public/js/profileGen.js View File

@ -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 = `
<div class="card shadow-sm" style="font-size: 16px;">
<div class="card-img-top" style="position: relative;">

Loading…
Cancel
Save