Skip to content

Commit

Permalink
Escaping only when is necessary
Browse files Browse the repository at this point in the history
Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
  • Loading branch information
rdwebdesign committed Jan 29, 2022
1 parent 4dab7a4 commit 61e3ba7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/pi-hole/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ $(function () {
render: function (data, type, row) {
// Show "unknown", when host is "*"
if (data == "*") {
return '<i>unknown</i>';
return "<i>unknown</i>";
} else {
return data;
return (
typeof data === "string" ?
data.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;") :
data
);
}
},
},
Expand Down

0 comments on commit 61e3ba7

Please sign in to comment.