From 402f21e5c60e4aba315e73e25b23b24422613de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1ts=20Levente?= Date: Sat, 23 Jan 2021 22:04:10 +0100 Subject: [PATCH] =?UTF-8?q?Hibajav=C3=ADt=C3=A1sok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit escapeHtml, color parsing, képnéző betöltés/megjelenítés --- approve.php | 18 ++++++++++++++---- js/color.js | 2 +- js/phw.js | 8 ++++++-- phw.css | 7 ++++++- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/approve.php b/approve.php index 0fbc4e4..df0317c 100644 --- a/approve.php +++ b/approve.php @@ -176,6 +176,16 @@ if ($logged_in) { }); } + // html-be biztonságosan beilleszthető string gyártása + // https://stackoverflow.com/a/6234804 + function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); + }