From 6886acfdd12a1bf9d5bf245ceb707f2300609ea4 Mon Sep 17 00:00:00 2001 From: ftimme <ft@falkotimme.com> Date: Sat, 08 Jun 2013 19:07:06 -0400 Subject: [PATCH] - Fixed FS#2896 - dns_zone_get_id PHP Code error. --- interface/lib/classes/functions.inc.php | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index a79942d..74f8400 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -130,10 +130,21 @@ } public function get_ispconfig_url() { + global $app; + $url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS') || stristr($_SERVER['HTTPS'],'on'))?'https':'http'; - $url .= '://'.$_SERVER['SERVER_NAME']; - if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { - $url .= ':'.$_SERVER['SERVER_PORT']; + if($_SERVER['SERVER_NAME'] != '_') { + $url .= '://'.$_SERVER['SERVER_NAME']; + if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { + $url .= ':'.$_SERVER['SERVER_PORT']; + } + } else { + $app->uses("getconf"); + $server_config = $app->getconf->get_server_config(1,'server'); + $url .= '://'.$server_config['hostname']; + if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) { + $url .= ':'.$_SERVER['SERVER_PORT']; + } } return $url; } -- Gitblit v1.9.1