diff options
author | Renato Botelho <renato@netgate.com> | 2017-03-02 10:13:37 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-03-08 13:42:40 -0300 |
commit | 458f5aee020859ed4a81bf8d5ad0ffabb3579155 (patch) | |
tree | 9af5cf59a402d3661d077d747a87f3edcc8f39c7 | |
parent | aa3e0749204a7f80c4717d86a2d44c4825888543 (diff) | |
download | pfsense-458f5aee020859ed4a81bf8d5ad0ffabb3579155.zip pfsense-458f5aee020859ed4a81bf8d5ad0ffabb3579155.tar.gz |
Use | to separate dyndns IPv4 fields on cache file as done by rfc2136 items and for all IPv6 items
-rw-r--r-- | src/etc/inc/dyndns.class | 6 | ||||
-rw-r--r-- | src/usr/local/www/services_dyndns.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index 76d8739..fe8d9b9 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -1526,7 +1526,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); } @@ -1632,14 +1632,14 @@ } 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 { conf_mount_rw(); $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}"); conf_mount_ro(); $cacheTime = $currentTime; $initial = true; diff --git a/src/usr/local/www/services_dyndns.php b/src/usr/local/www/services_dyndns.php index 5d466ed..b56636b 100644 --- a/src/usr/local/www/services_dyndns.php +++ b/src/usr/local/www/services_dyndns.php @@ -181,7 +181,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 c1cbdbe..27ee09d 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 @@ -117,7 +117,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) { |