Commit 93c20e1b authored by Franco Fichtner's avatar Franco Fichtner

src: tweak previous, php can be picky

parent 61cb3745
...@@ -41,7 +41,7 @@ while (true) { ...@@ -41,7 +41,7 @@ while (true) {
$string = fgets($handle, 256); $string = fgets($handle, 256);
$elements = array(); $elements = array();
$elements = preg_split(":", $string, null); $elements = preg_split('/:/', $string);
$elements[0] = trim($elements[0]); $elements[0] = trim($elements[0]);
$elements[1] = trim($elements[1]); $elements[1] = trim($elements[1]);
...@@ -60,7 +60,7 @@ while (true) { ...@@ -60,7 +60,7 @@ while (true) {
break; break;
case "^DSFLOWRPT": case "^DSFLOWRPT":
$items = array(); $items = array();
$items = preg_split(",", $elements[1], null); $items = preg_split('/,/', $elements[1]);
$record['time'] = hexdec($items[0]); $record['time'] = hexdec($items[0]);
$record['upstream'] = round((floatval(hexdec($items[1])) * 8) /1024); $record['upstream'] = round((floatval(hexdec($items[1])) * 8) /1024);
$record['downstream'] = round((floatval(hexdec($items[2])) * 8) /1024); $record['downstream'] = round((floatval(hexdec($items[2])) * 8) /1024);
......
...@@ -55,7 +55,7 @@ if ($_REQUEST['getdyndnsstatus']) { ...@@ -55,7 +55,7 @@ if ($_REQUEST['getdyndnsstatus']) {
$filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache"; $filename = "/conf/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
if (file_exists($filename)) { if (file_exists($filename)) {
$ipaddr = dyndnsCheckIP($dyndns['interface']); $ipaddr = dyndnsCheckIP($dyndns['interface']);
$cached_ip_s = preg_split(":", file_get_contents($filename), null); $cached_ip_s = preg_split('/:/', file_get_contents($filename));
$cached_ip = $cached_ip_s[0]; $cached_ip = $cached_ip_s[0];
if ($ipaddr <> $cached_ip) { if ($ipaddr <> $cached_ip) {
echo "<font color='red'>"; echo "<font color='red'>";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment