diff options
author | TechSneeze <dave@techsneeze.com> | 2022-07-21 21:03:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-21 21:03:07 +0300 |
commit | 5901db238cd905f2313caf6379cfd8c00d38cb45 (patch) | |
tree | 35ee4e28617e7f305c4a0c9734cc8993fdeff5ea /dmarcts-report-viewer-common.php | |
parent | 80b1574d9c7a7362141cfa24e436a699ff1c800e (diff) | |
parent | 9641d1364b9cd93d0325ca2dccfaa3e50126310f (diff) |
PHP8 compatibility
Diffstat (limited to 'dmarcts-report-viewer-common.php')
-rw-r--r-- | dmarcts-report-viewer-common.php | 9 |
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() { |