summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizard.php
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-22 18:40:41 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-22 18:40:41 +0000
commit037304d866d5f9fab6a84a8d3a5499b44812f191 (patch)
treef91d959bf88e78972736ff993ccdc81f2f8c4d5b /usr/local/www/wizard.php
parent48cd521114639f75dce00190cd04b83c7237c4e0 (diff)
downloadpfsense-037304d866d5f9fab6a84a8d3a5499b44812f191.zip
pfsense-037304d866d5f9fab6a84a8d3a5499b44812f191.tar.gz
MFC 7049
Fix protocol detection for $myurl Stop $myurl from putting : in url when no alternate port is selected
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-xusr/local/www/wizard.php31
1 files changed, 22 insertions, 9 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index 383f81d..faa980f 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -511,15 +511,28 @@ function fixup_string($string) {
global $config, $myurl;
$newstring = $string;
// fixup #1: $myurl -> http[s]://ip_address:port/
- $https = "";
+ switch($config['system']['webguiproto']) {
+ case "http":
+ $proto = "http";
+ break;
+ case "https":
+ $proto = "https";
+ break;
+ default:
+ $proto = "http";
+ break;
+ }
$port = $config['system']['webguiport'];
- if($port <> "443" and $port <> "80")
- $urlport = ":" . $port;
- else
- $urlport = "";
- if($config['system']['webguiproto'] == "https")
- $https = "s";
- $myurl = "http" . $https . "://" . $config['interfaces']['lan']['ipaddr'] . $urlport;
+ if($port != "") {
+ if(($port == "443" and $proto != "https") or ($port == "80" and $proto != "http")) {
+ $urlport = ":" . $port;
+ } elseif ($port != "80" and $port != "443") {
+ $urlport = ":" . $port;
+ } else {
+ $urlport = "";
+ }
+ }
+ $myurl = $proto . "://" . $config['interfaces']['lan']['ipaddr'] . $urlport . "/";
$newstring = str_replace("\$myurl", $myurl, $newstring);
// fixup #2: $wanip
$curwanip = get_current_wan_address();
@@ -535,4 +548,4 @@ function is_timezone($elt) {
return !preg_match("/\/$/", $elt);
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud