diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/plugin.php | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/include/plugin.php b/include/plugin.php index f0ae1ecb1..f9cee7ed6 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -963,44 +963,6 @@ function format_css_if_exists($source) { } } -/** - * This basically calculates the baseurl. We have other functions to do that, but - * there was an issue with script paths and mixed-content whose details are arcane - * and perhaps lost in the message archives. The short answer is that we're ignoring - * the URL which we are "supposed" to use, and generating script paths relative to - * the URL which we are currently using; in order to ensure they are found and aren't - * blocked due to mixed content issues. - * - * @return string - */ -function script_path() { - if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS']) - $scheme = 'https'; - elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443)) - $scheme = 'https'; - elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') - $scheme = 'https'; - else - $scheme = 'http'; - - // Some proxy setups may require using http_host - - if(isset(App::$config['system']['script_path_use_http_host']) && intval(App::$config['system']['script_path_use_http_host'])) - $server_var = 'HTTP_HOST'; - else - $server_var = 'SERVER_NAME'; - - - if(x($_SERVER,$server_var)) { - $hostname = $_SERVER[$server_var]; - } - else { - return z_root(); - } - - return $scheme . '://' . $hostname; -} - function head_add_js($src, $priority = 0) { if(isset(App::$js_sources[$priority]) && !is_array(App::$js_sources[$priority])) App::$js_sources[$priority] = []; |