From 77d1a5a012938b20e14a972be5b67a54a8aa0d57 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Fri, 14 Apr 2017 16:00:53 +0200 Subject: [PATCH] Fix: html encode special characters --- index.php | 10 +++++----- js/admin.js | 6 +++--- js/main.js | 24 +++++++++++++++++++----- utils/download.php | 2 +- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index 9855869..5372e20 100755 --- a/index.php +++ b/index.php @@ -108,7 +108,7 @@ isValid): ?>
- <?= $lang[" src="images/user.svg"> login ?> + <?= $lang[" src="images/user.svg"> login) ?> diff --git a/js/admin.js b/js/admin.js index 8fcca1a..8a8ee1e 100644 --- a/js/admin.js +++ b/js/admin.js @@ -33,12 +33,12 @@ function editUser() { alert(lang['selfeditwarn']); return; } - var message = '
' + sprintf(lang['editinguser'], '' + userLogin + '') + '
'; + var message = '
' + sprintf(lang['editinguser'], '' + htmlEncode(userLogin) + '') + '
'; message += ''; message += '
'; var form = '
'; - form += ''; + form += ''; form += ''; form += ''; form += '
'; @@ -52,7 +52,7 @@ function confirmedDelete(login) { function submitUser(action) { var form = document.getElementById('userForm'); - var login = form.elements['login'].value; + var login = form.elements['login'].value.trim(); if (!login) { alert(lang['allrequired']); return; diff --git a/js/main.js b/js/main.js index d7d4688..c04fc0f 100755 --- a/js/main.js +++ b/js/main.js @@ -194,11 +194,11 @@ function getPopupHtml(p, i, count) { popup = '