diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-07-05 23:19:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-05 23:19:35 +0300 |
commit | 57e252ff5a2fcfaf634a6ee2dd1ec7af8d41632d (patch) | |
tree | 5068eb2ffdbcc7c0dc8478caaa43700cb3edd530 /plugins | |
parent | 41615714f22f91c03d60f220bd91b80467bb5b7b (diff) |
Improve host validation (#16169)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ScheduledReports/config/tcpdf_config.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/ScheduledReports/config/tcpdf_config.php b/plugins/ScheduledReports/config/tcpdf_config.php index 2cd327ea10..03a466c708 100644 --- a/plugins/ScheduledReports/config/tcpdf_config.php +++ b/plugins/ScheduledReports/config/tcpdf_config.php @@ -53,7 +53,15 @@ if (!defined('K_TCPDF_EXTERNAL_CONFIG')) { if (!defined('K_PATH_URL')) { // Automatic calculation for the following K_PATH_URL constant $k_path_url = K_PATH_MAIN; // default value for console mode - if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { + if (isset($_SERVER['SERVER_NAME']) AND (!empty($_SERVER['SERVER_NAME']))) { + if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') { + $k_path_url = 'https://'; + } else { + $k_path_url = 'http://'; + } + $k_path_url .= $_SERVER['SERVER_NAME']; + $k_path_url .= str_replace('\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1))); + } elseif (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS']) != 'off') { $k_path_url = 'https://'; } else { |