From 01c5da322a25f3c0af92f9af3dc939cf6f1f2b1c Mon Sep 17 00:00:00 2001 From: divinity76 Date: Mon, 26 Aug 2019 02:11:02 +0200 Subject: [PATCH] html-encode dynamic values in buypoints.php (#364) * add html encoding function * html-encode dynamic values important if the values contain special characters like '&<>" (for example if $config['site_title'] is `AT&T` or ``, the old code would generate invalid html, but this updated code will generate valid html.) --- buypoints.php | 34 +++++++++++++++++----------------- engine/function/general.php | 4 ++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/buypoints.php b/buypoints.php index 6b4b275..e61cbdd 100644 --- a/buypoints.php +++ b/buypoints.php @@ -31,19 +31,19 @@ if ($paypal['enabled']) {
- - + + - + - - + + - +
@@ -59,13 +59,13 @@ if ($paypal['enabled']) { if ($config['pagseguro']['enabled'] == true) { ?>

Buy points using Pagseguro:

-
- + + - + - + @@ -80,15 +80,15 @@ if ($config['paygol']['enabled'] == true) {

Buy points using Paygol:

-

+

- - - - + + + + - - + +
success) && $json->success; } +// html encoding function (encode any string to valid UTF-8 HTML) +function hhb_tohtml(/*string*/ $str)/*:string*/ { + return htmlentities($str, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE | ENT_DISALLOWED, 'UTF-8', true); +} ?>