diff --git a/static/js/grid_loader.js b/static/js/grid_loader.js index f203bd7..39ba154 100644 --- a/static/js/grid_loader.js +++ b/static/js/grid_loader.js @@ -88,11 +88,20 @@ const insertGame = (gridboxnum, game) => { const insertLeague = (league) => { var btn = document.createElement("BUTTON"); btn.className = "filter"; - btn.innerHTML = league; + btn.innerHTML = escapeHtml(league); $('#filters').append(btn); return btn; } +function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + } + const clearBox = (box) => { box.className = "emptyslot"; box.timestamp = null; diff --git a/templates/game_box.html b/templates/game_box.html index c4d1d1d..d94ac25 100644 --- a/templates/game_box.html +++ b/templates/game_box.html @@ -5,18 +5,18 @@ src={% if state.bases[number] %}"/static/img/base_filled.png" alt="{{state.bases {% if number <= state.outs %}/static/img/out_out.png{% else %}/static/img/out_in.png{% endif %} {%- endmacro %}