From 665ad9aa836f874b3edc59d5ef5835f0978a5e0a Mon Sep 17 00:00:00 2001 From: danpros Date: Sun, 21 Feb 2021 12:15:47 +0700 Subject: [PATCH] Make sure to return htmlspecialchars --- system/admin/views/config-custom.html.php | 18 +----------------- system/admin/views/config-metatags.html.php | 2 +- system/admin/views/config-widget.html.php | 14 +++++++------- system/admin/views/config.html.php | 10 +++++----- system/includes/functions.php | 15 +++++++++++++++ 5 files changed, 29 insertions(+), 30 deletions(-) diff --git a/system/admin/views/config-custom.html.php b/system/admin/views/config-custom.html.php index 293d34d..8bf8512 100644 --- a/system/admin/views/config-custom.html.php +++ b/system/admin/views/config-custom.html.php @@ -23,26 +23,10 @@ "hallo", - ); + $array = array(); if (file_exists($config_file)) { $array = parse_ini_file($config_file, true); } - function valueMaker($value) - { - if (is_string($value)) - return htmlspecialchars($value); - - if ($value === true) - return "true"; - if ($value === false) - return "false"; - - if ($value == false) - return "0"; - return (string)$value; - } $configList = json_decode(file_get_contents('content/data/configList.json', true)); foreach ($array as $key => $value) { if (!in_array($key, $configList)) { diff --git a/system/admin/views/config-metatags.html.php b/system/admin/views/config-metatags.html.php index 1cbe8e8..5b14976 100644 --- a/system/admin/views/config-metatags.html.php +++ b/system/admin/views/config-metatags.html.php @@ -1,4 +1,4 @@ -
- +
- +

@@ -117,13 +117,13 @@
- +
- +

@@ -132,20 +132,20 @@
- +
- + This is legacy code. Usually new created analyics using gtag.js
- + For google-site-verification meta
diff --git a/system/admin/views/config.html.php b/system/admin/views/config.html.php index 505d6f1..b8aae25 100644 --- a/system/admin/views/config.html.php +++ b/system/admin/views/config.html.php @@ -16,33 +16,33 @@
- +
- +
- + In a few words, explain what this blog is about.
- + In one paragraph, tell us more about your blog.
- +
diff --git a/system/includes/functions.php b/system/includes/functions.php index 491205c..fe949be 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -3321,3 +3321,18 @@ function format_date($date) } } + +function valueMaker($value) +{ + if (is_string($value)) + return htmlspecialchars($value); + + if ($value === true) + return "true"; + if ($value === false) + return "false"; + + if ($value == false) + return "0"; + return (string)$value; +} \ No newline at end of file