diff options
author | Renato Botelho <renato@netgate.com> | 2017-03-02 10:13:37 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-03-02 10:21:55 -0300 |
commit | 5be33f49c5d5d70d9a11822f77eff3a312b43545 (patch) | |
tree | 441c36f4f0c37fac655b3cb8608117c2bfe484d6 | |
parent | 1877e4d9891cc421b4849dac87cb2824905bf412 (diff) | |
download | pfsense-5be33f49c5d5d70d9a11822f77eff3a312b43545.zip pfsense-5be33f49c5d5d70d9a11822f77eff3a312b43545.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 ddbea57..6e273bc 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -1525,7 +1525,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); } @@ -1631,14 +1631,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 72fe6cb..0224177 100644 --- a/src/usr/local/www/services_dyndns.php +++ b/src/usr/local/www/services_dyndns.php @@ -182,7 +182,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) { |