Skip to content

Commit

Permalink
Added regex sanitisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dialpuri committed Oct 4, 2023
1 parent 85d4b5d commit 9d831ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webserver/src/pages/Home/HomeSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default function HomeSection() {
const [resetApp, setResetApp] = useState(false)
const [fallback, setFallBack] = useState(false)

let sanitize_id = (id) => {
const regex = /: *32/g;
const new_id = id.replace(regex, "")
return new_id
}

useEffect(() => {
privateer_module().then((Module) => {
var reader = new FileReader();
Expand All @@ -35,6 +41,8 @@ export default function HomeSection() {
for (var i = 0; i < x.size(); i++) {
let table_entry = x.get(i)

table_entry.id = sanitize_id(table_entry.id)

let collected_torsions = []
for(var j = 0; j < table_entry.torsions.size(); j++) {
collected_torsions.push(table_entry.torsions.get(j));
Expand Down

0 comments on commit 9d831ee

Please sign in to comment.