Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejey committed Jun 11, 2021
1 parent ebe7522 commit f541b33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/caching.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ function saveToCache($key, $value)
}

$rec = array('KEYWORD' => $key, 'DATAVALUE' => $value);
$sqlQuery = "REPLACE INTO cached_values (KEYWORD, DATAVALUE, EXPIRE) " .
$sqlQuery = "REPLACE INTO cached_values (KEYWORD, DATAVALUE) " .
" VALUES ('" . DbSafe1($rec['KEYWORD']) . "', " .
"'" . DbSafe1($rec['DATAVALUE']) . "', '".date('Y-m-d H:i:s',time()+24*60*60)."')";
"'" . DbSafe1($rec['DATAVALUE']) . "')";
SQLExec($sqlQuery);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/connect/connect.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ function sendDeviceProperty($property, $value)
$url = 'https://connect.smartliving.ru/sync_device_data.php';
$fields = array();
list($object_name, $property_name) = explode('.', $property);
$device_rec = SQLSelectOne("SELECT ID, TITLE, TYPE, SUBTYPE, SYSTEM_DEVICE, ARCHIVED FROM devices WHERE LINKED_OBJECT='" . DBSafe($object_name) . "' AND SYSTEM_DEVICE=0 AND ARCHIVED=0");
$device_rec = SQLSelectOne("SELECT ID, TITLE, TYPE, SUBTYPE, SYSTEM_DEVICE, ARCHIVED, FAVORITE FROM devices WHERE LINKED_OBJECT='" . DBSafe($object_name) . "' AND SYSTEM_DEVICE=0 AND ARCHIVED=0");
if (!$device_rec['ID'] || $device_rec['SYSTEM_DEVICE'] || $device_rec['ARCHIVED']) return;
$fields['object'] = $object_name;
$fields['property'] = $property_name;
Expand Down

0 comments on commit f541b33

Please sign in to comment.