Remove now unused function script_path.

This commit is contained in:
Harald Eilertsen
2022-03-03 19:50:07 +01:00
parent 65ed3818ec
commit 34ffff3947

View File

@@ -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] = [];