Skip to content

Commit

Permalink
Update cycle_upnpevents.php
Browse files Browse the repository at this point in the history
  • Loading branch information
tarasfrompir committed Apr 17, 2019
1 parent 02b1fcd commit f0d4529
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/cycle_upnpevents.php
Expand Up @@ -74,9 +74,11 @@
$last_change = $doc->getElementsByTagName('LastChange') [0];
$value = $last_change->nodeValue;
if ($value) {
//DebMes ('value - '.$value);
$value = preg_replace('/<([[:word:]]+) val="(\d*)"/', '<$1>$2</$1', $value);
$value = preg_replace('/<([[:word:]]+) [[:word:]]+="([[:word:]]+)" val="(\d*)"\//', '<$1$2>$3</$1$2', $value);
$value = preg_replace('/<([[:word:]]+) val="(\d+:\d+:\d+)"\//', '<$1>$2</$1', $value);
$value = preg_replace('/<([[:word:]]+) val="([[:word:]]+)"\/>/', '<$1>$2</$1>', $value);
$value = preg_replace('/<([[:word:]]+) val="([^"]+)"\/>/', '<$1>$2</$1>', $value);
$value = str_replace("></InstanceID>", ">", $value);

DebMes ('value - '.$value);
Expand Down Expand Up @@ -113,7 +115,7 @@
if ($value=='NOT_IMPLEMENTED') {
$value='';
}
if ($field AND $value) {
if ($field AND $value!='') {
setGlobal($name_device . '.' . $f_name, $value);
}
}
Expand Down

0 comments on commit f0d4529

Please sign in to comment.