Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/techsneeze/dmarcts-report-viewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTechSneeze <dave@techsneeze.com>2022-07-21 21:03:07 +0300
committerGitHub <noreply@github.com>2022-07-21 21:03:07 +0300
commit5901db238cd905f2313caf6379cfd8c00d38cb45 (patch)
tree35ee4e28617e7f305c4a0c9734cc8993fdeff5ea /dmarcts-report-viewer-common.php
parent80b1574d9c7a7362141cfa24e436a699ff1c800e (diff)
parent9641d1364b9cd93d0325ca2dccfaa3e50126310f (diff)
Merge pull request #81 from ekalin/php8HEADv2.0master
PHP8 compatibility
Diffstat (limited to 'dmarcts-report-viewer-common.php')
-rw-r--r--dmarcts-report-viewer-common.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/dmarcts-report-viewer-common.php b/dmarcts-report-viewer-common.php
index 57811a1..6d5be4c 100644
--- a/dmarcts-report-viewer-common.php
+++ b/dmarcts-report-viewer-common.php
@@ -349,6 +349,15 @@ function format_date($date, $format) {
return $answer;
};
+// null-safe version of htmlspecialchars for PHP 8+ compatibility
+// --------------------------------------------------------------------------
+function html_escape($str) {
+ if ($str == null) {
+ return null;
+ }
+ return htmlspecialchars($str);
+}
+
// Get all configuration options
// --------------------------------------------------------------------------
function configure() {