Fixed bugs with PostgreSQL in bruteforce and feed models

pull/5746/head
Bechkalo Evgeny 2020-03-30 16:19:43 +03:00
parent 939c8b4514
commit 4d5f1aaf00
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class Bruteforce extends AppModel
if ($dataSource == 'Database/Mysql') {
$sql = 'DELETE FROM bruteforces WHERE `expire` <= "' . $expire . '";';
} elseif ($dataSource == 'Database/Postgres') {
$sql = 'DELETE FROM bruteforces WHERE expire <= "' . $expire . '";';
$sql = 'DELETE FROM bruteforces WHERE expire <= \'' . $expire . '\';';
}
$this->query($sql);
}

View File

@ -1187,7 +1187,7 @@ class Feed extends AppModel
'recursive' => -1,
'fields' => array('id', 'url', 'name'),
'contain' => array('RemoteOrg' => array('fields' => array('RemoteOrg.id', 'RemoteOrg.name'))),
'conditions' => array('Server.caching_enabled')
'conditions' => array('Server.caching_enabled' => 1)
));
foreach ($servers as $k => $server) {
if (!$redis->exists('misp:server_cache:' . $server['Server']['id'])) {