Avoid a XSS issue

This commit is contained in:
Robohash 2013-08-16 12:32:25 -04:00
parent 3ed19f4271
commit 1c90774ffd

View File

@ -215,9 +215,7 @@ function submitform()
{ {
var x = document.getElementById("idimg"); var x = document.getElementById("idimg");
x.setAttribute("src", "https://robohash.org/" + document.getElementById("textform").query.value ); x.setAttribute("src", "https://robohash.org/" + document.getElementById("textform").query.value );
var y = document.getElementById("YourIP"); $("#YourIP").text( "http://robohash.org/" + document.getElementById("textform").query.value);
y.innerHTML = "http://robohash.org/" + document.getElementById("textform").query.value;
} }
</script> </script>