From 2354d7e7986915713d76ccb7c96d3dcec6c2a38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 13 Mar 2020 14:27:34 +0100 Subject: fix xss from gse --- js/gsec.js | 10 +++++----- sw.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/gsec.js b/js/gsec.js index 6e59db7..8d02d44 100644 --- a/js/gsec.js +++ b/js/gsec.js @@ -21,7 +21,7 @@ class gsec { type: "GET", dataType: "html", success: (getData) => { - var parsed = document.createElement("html"); + var parsed = document.createElement("template"); parsed.innerHTML = getData; if(formId == null) { var form = parsed.getElementsByTagName("form")[0]; @@ -63,7 +63,7 @@ class gsec { return new Promise((resolve, reject) => { var dataToSend = {"edtGSEUserId": usernameToLogin, "edtGSEUserPassword": passwordToLogin, "btnLogin": "Prijava"}; this.postback(GSE_URL+"Logon.aspx", dataToSend).then( (response) => { - var parsed = document.createElement("html"); + var parsed = document.createElement("template"); parsed.innerHTML = response.data; if(response.code == 302) { resolve(true); @@ -150,7 +150,7 @@ class gsec { return new Promise((resolve, reject) => { var urnik = { 0: {}, 1: {}, 2: {}, 3: {}, 4: {}, 5: {}, 6:{} } ; this.postback(GSE_URL+"Page_Gim/Ucenec/DnevnikUcenec.aspx", dataToSend, null, true).then( (response) => { - var parsed = document.createElement("html"); + var parsed = document.createElement("template"); parsed.innerHTML = response.data; for(const urnikElement of parsed.querySelectorAll('*[id^="ctl00_ContentPlaceHolder1_wkgDnevnik_btnCell_"]')) { var subFields = urnikElement.id.split("_"); @@ -172,7 +172,7 @@ class gsec { return new Promise((resolve, reject) => { var gradings = []; this.postback(GSE_URL+"Page_Gim/Ucenec/IzpitiUcenec.aspx", {}, null, true).then( (response) => { - var parsed = document.createElement("html"); + var parsed = document.createElement("template"); parsed.innerHTML = response.data; var rowElements = parsed.getElementsByTagName("table")[0].getElementsByTagName("tbody")[0].getElementsByTagName("tr"); for (const row of rowElements) { @@ -197,7 +197,7 @@ class gsec { return new Promise((resolve, reject) => { var Teachers = {}; this.postback(GSE_URL+"Page_Gim/Ucenec/UciteljskiZbor.aspx", {}, null, true).then((response)=>{ - var parsed = document.createElement("html"); + var parsed = document.createElement("template"); parsed.innerHTML = response.data; var rowElements = parsed.getElementsByTagName("table")[0].getElementsByTagName("tbody")[0].getElementsByTagName("tr"); for(const row of rowElements) { diff --git a/sw.js b/sw.js index 091edd5..371523c 100644 --- a/sw.js +++ b/sw.js @@ -1,5 +1,5 @@ // Change version to cause cache refresh -const static_cache_name = "site-static-v1.0.12.54"; +const static_cache_name = "site-static-v1.0.12.55"; // Got them with find . -not -path '*/\.*' | sed "s/.*/\"&\",/" | grep -v sw.js // sw.js NE SME BITI CACHAN, ker vsebuje verzijo! -- cgit v1.2.3