mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-10 16:25:47 +00:00
23 lines
511 B
PHP
23 lines
511 B
PHP
![]() |
<?php
|
||
|
|
||
|
if (!function_exists('host_url')) {
|
||
|
/**
|
||
|
* Return the host URL to use in views
|
||
|
*
|
||
|
* @return string|false
|
||
|
*/
|
||
|
function host_url()
|
||
|
{
|
||
|
if (isset($_SERVER['host'])) {
|
||
|
$protocol =
|
||
|
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
|
||
|
$_SERVER['SERVER_PORT'] == 443
|
||
|
? 'https://'
|
||
|
: 'http://';
|
||
|
return $protocol + $_SERVER['host'];
|
||
|
}
|
||
|
|
||
|
return false;
|
||
|
}
|
||
|
}
|