mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
IDS / crash reports, closes https://github.com/opnsense/core/issues/1117
This commit is contained in:
parent
6e06097709
commit
7bf1343bf7
@ -147,15 +147,19 @@ class SettingsController extends ApiControllerBase
|
||||
|
||||
/**
|
||||
* get rule information
|
||||
* @param $sid rule identifier
|
||||
* @param string|null $sid rule identifier
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function getRuleInfoAction($sid)
|
||||
public function getRuleInfoAction($sid=null)
|
||||
{
|
||||
// request list of installed rules
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdpRun("ids query rules", array(1, 0,'sid/'.$sid));
|
||||
$data = json_decode($response, true);
|
||||
if (!empty($sid)) {
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdpRun("ids query rules", array(1, 0,'sid/'.$sid));
|
||||
$data = json_decode($response, true);
|
||||
} else {
|
||||
$data = null;
|
||||
}
|
||||
|
||||
if ($data != null && array_key_exists("rows", $data) && count($data['rows'])>0) {
|
||||
$row = $data['rows'][0];
|
||||
|
||||
@ -131,7 +131,7 @@ class IDS extends BaseModel
|
||||
public function getRuleStatus($sid, $default)
|
||||
{
|
||||
$this->updateSIDlist();
|
||||
if (array_key_exists($sid, $this->sid_list)) {
|
||||
if (!empty($sid) && array_key_exists($sid, $this->sid_list)) {
|
||||
return (string)$this->sid_list[$sid]->enabled;
|
||||
} else {
|
||||
return $default;
|
||||
@ -148,7 +148,7 @@ class IDS extends BaseModel
|
||||
public function getRuleAction($sid, $default, $response_plain = false)
|
||||
{
|
||||
$this->updateSIDlist();
|
||||
if (array_key_exists($sid, $this->sid_list)) {
|
||||
if (!empty($sid) && array_key_exists($sid, $this->sid_list)) {
|
||||
if (!$response_plain) {
|
||||
return $this->sid_list[$sid]->action->getNodeData();
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user