summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-03-02 10:13:37 -0300
committerRenato Botelho <renato@netgate.com>2017-03-02 10:13:37 -0300
commitd51cdd48d55fa440dec19f96bec43a93e30efe7a (patch)
treea1bf431e356b1b01586beac3fed9f5f238cf5865 /src
parent6dbc42de35e83d8fe94b616d2f40cc5e171e9d61 (diff)
downloadpfsense-d51cdd48d55fa440dec19f96bec43a93e30efe7a.zip
pfsense-d51cdd48d55fa440dec19f96bec43a93e30efe7a.tar.gz
Use | to separate dyndns IPv4 fields on cache file as done by rfc2136 items and for all IPv6 items
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/dyndns.class6
-rw-r--r--src/usr/local/www/services_dyndns.php2
-rw-r--r--src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class
index c88feca..af85113 100644
--- a/src/etc/inc/dyndns.class
+++ b/src/etc/inc/dyndns.class
@@ -1492,7 +1492,7 @@
$currentTime = time();
notify_all_remote(sprintf(gettext('DynDNS updated IP Address on %1$s (%2$s) to %3$s'), convert_real_interface_to_friendly_descr($this->_if), $this->_if, $wan_ip));
log_error(sprintf(gettext('phpDynDNS: updating cache file %1$s: %2$s'), $this->_cacheFile, $wan_ip));
- @file_put_contents($this->_cacheFile, "{$wan_ip}:{$currentTime}");
+ @file_put_contents($this->_cacheFile, "{$wan_ip}|{$currentTime}");
} else {
@unlink($this->_cacheFile);
}
@@ -1595,13 +1595,13 @@
} else {
if (file_exists($this->_cacheFile)) {
$contents = file_get_contents($this->_cacheFile);
- list($cacheIP, $cacheTime) = explode(':', $contents);
+ list($cacheIP, $cacheTime) = explode('|', $contents);
$this->_debug($cacheIP.'/'.$cacheTime);
$initial = false;
$log_error .= sprintf(gettext("Cached IP: %s"), $cacheIP);
} else {
$cacheIP = '0.0.0.0';
- @file_put_contents($this->_cacheFile, "0.0.0.0:{$currentTime}");
+ @file_put_contents($this->_cacheFile, "0.0.0.0|{$currentTime}");
$cacheTime = $currentTime;
$initial = true;
$log_error .= gettext("No Cached IP found.");
diff --git a/src/usr/local/www/services_dyndns.php b/src/usr/local/www/services_dyndns.php
index 3c7777a..cf4f471 100644
--- a/src/usr/local/www/services_dyndns.php
+++ b/src/usr/local/www/services_dyndns.php
@@ -151,7 +151,7 @@ foreach ($a_dyndns as $dyndns):
$filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}_v6.cache";
if (file_exists($filename)) {
$ipaddr = dyndnsCheckIP($dyndns['interface']);
- $cached_ip_s = explode(":", file_get_contents($filename));
+ $cached_ip_s = explode("|", file_get_contents($filename));
$cached_ip = $cached_ip_s[0];
if ($ipaddr != $cached_ip) {
diff --git a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
index 15f6952..3f6c530 100644
--- a/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
@@ -85,7 +85,7 @@ if ($_REQUEST['getdyndnsstatus']) {
$filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($hostname) . "{$dyndns['id']}_v6.cache";
if (file_exists($filename)) {
$ipaddr = dyndnsCheckIP($dyndns['interface']);
- $cached_ip_s = explode(":", file_get_contents($filename));
+ $cached_ip_s = explode("|", file_get_contents($filename));
$cached_ip = $cached_ip_s[0];
if ($ipaddr != $cached_ip) {
OpenPOWER on IntegriCloud