summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-02-26 18:27:55 +0000
committerErmal Luçi <eri@pfsense.org>2010-02-26 18:27:55 +0000
commitd70a5ac6d7d0d64d45e6ca56f9bfcf623867a8a7 (patch)
tree3a8c9913c8f9f35995b6176cb65184a72036a021 /usr/local/www
parenta55cdcc09b3fbfa60be2fef301146ae56c6ae4b8 (diff)
downloadpfsense-d70a5ac6d7d0d64d45e6ca56f9bfcf623867a8a7.zip
pfsense-d70a5ac6d7d0d64d45e6ca56f9bfcf623867a8a7.tar.gz
Ticket #313. Search if the string to be replaced really exists instead of doing a blind replace.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/wizard.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index 45302b3..f50d469 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -654,13 +654,19 @@ function fixup_string($string) {
}
}
$myurl = $proto . "://" . $_SERVER['HTTP_HOST'] . $urlport . "/";
- $newstring = str_replace("\$myurl", $myurl, $newstring);
+
+ if (strstr($newstring, "\$myurl"))
+ $newstring = str_replace("\$myurl", $myurl, $newstring);
// fixup #2: $wanip
- $curwanip = get_interface_ip();
- $newstring = str_replace("\$wanip", $curwanip, $newstring);
+ if (strstr($newstring, "\$wanip")) {
+ $curwanip = get_interface_ip();
+ $newstring = str_replace("\$wanip", $curwanip, $newstring);
+ }
// fixup #3: $lanip
- $lanip = get_interface_ip("lan");
- $newstring = str_replace("\$lanip", $lanip, $newstring);
+ if (strstr($newstring, "\$lanip")) {
+ $lanip = get_interface_ip("lan");
+ $newstring = str_replace("\$lanip", $lanip, $newstring);
+ }
// fixup #4: fix'r'up here.
return $newstring;
}
OpenPOWER on IntegriCloud