@@ -938,7 +938,7 @@ function cleanUpValueHistory($value_id, $max_age_days, $data_type = 0)
938938 $ total_removed = 0 ;
939939
940940 if (defined ('SEPARATE_HISTORY_STORAGE ' ) && SEPARATE_HISTORY_STORAGE == 1 ) {
941- $ table_name = 'phistory_value_ ' . $ value_id ;
941+ $ table_name = 'phistory_value_ ' . $ value_id ;
942942 } else {
943943 $ table_name = 'phistory ' ;
944944 }
@@ -958,7 +958,7 @@ function cleanUpValueHistory($value_id, $max_age_days, $data_type = 0)
958958 }
959959
960960 $ tmp = SQLSelectOne ("SELECT COUNT(*) as TOTAL FROM $ table_name WHERE $ qry " );
961- if (isset ($ tmp ['TOTAL ' ]) && $ tmp ['TOTAL ' ]> 0 ) {
961+ if (isset ($ tmp ['TOTAL ' ]) && $ tmp ['TOTAL ' ] > 0 ) {
962962 $ total_removed = (int )$ tmp ['TOTAL ' ];
963963 SQLExec ("DELETE FROM $ table_name WHERE $ qry " );
964964 }
@@ -968,12 +968,12 @@ function cleanUpValueHistory($value_id, $max_age_days, $data_type = 0)
968968function cleanUpPropertyHistory ($ property_id , $ max_age_days )
969969{
970970 $ total_removed = 0 ;
971- $ property = SQLSelectOne ("SELECT * FROM properties WHERE ID= " . (int )$ property_id );
971+ $ property = SQLSelectOne ("SELECT * FROM properties WHERE ID= " . (int )$ property_id );
972972 if (isset ($ property ['ID ' ])) {
973973 $ pvalues = SQLSelect ("SELECT * FROM pvalues WHERE PROPERTY_ID=' " . $ property_id . "' " );
974974 $ total = count ($ pvalues );
975975 for ($ i = 0 ; $ i < $ total ; $ i ++) {
976- $ total_removed+= cleanUpValueHistory ($ pvalues [$ i ]['ID ' ], $ max_age_days , $ property ['DATA_TYPE ' ]);
976+ $ total_removed += cleanUpValueHistory ($ pvalues [$ i ]['ID ' ], $ max_age_days , $ property ['DATA_TYPE ' ]);
977977 }
978978 }
979979 return $ total_removed ;
@@ -1487,7 +1487,7 @@ function objectClassChanged($object_id)
14871487function checkOperationsQueue ($ topic )
14881488{
14891489 $ data = SQLSelect ("SELECT * FROM operations_queue WHERE TOPIC=' " . DBSafe ($ topic ) . "' ORDER BY EXPIRE " );
1490- if ($ data [0 ]['TOPIC ' ]) {
1490+ if (isset ( $ data [0 ]['TOPIC ' ]) ) {
14911491 SQLExec ("DELETE FROM operations_queue WHERE TOPIC=' " . DBSafe ($ topic ) . "' " );
14921492 }
14931493 return $ data ;
0 commit comments