mirror of https://github.com/MISP/MISP
fix: Replace not exists MethodNotFoundException with NotFoundException
parent
cf6bc6f204
commit
4ef9595023
|
@ -173,7 +173,7 @@ class LogsController extends AppController
|
|||
)
|
||||
);
|
||||
if (empty($event)) {
|
||||
throw new MethodNotFoundException('Invalid event.');
|
||||
throw new NotFoundException('Invalid event.');
|
||||
}
|
||||
$event = $event[0];
|
||||
$attribute_ids = array();
|
||||
|
|
|
@ -4240,10 +4240,6 @@ class Attribute extends AppModel
|
|||
if ($paramsOnly) {
|
||||
return $params;
|
||||
}
|
||||
if (!isset($this->validFormats[$returnFormat])) {
|
||||
// this is where the new code path for the export modules will go
|
||||
throw new MethodNotFoundException('Invalid export format.');
|
||||
}
|
||||
if (method_exists($exportTool, 'modify_params')) {
|
||||
$params = $exportTool->modify_params($user, $params);
|
||||
}
|
||||
|
|
|
@ -2897,6 +2897,9 @@ class Event extends AppModel
|
|||
public function sendAlertEmail($id, $senderUser, $oldpublish = null, $processId = null)
|
||||
{
|
||||
$event = $this->fetchEvent($senderUser, array('eventid' => $id, 'includeAllTags' => true));
|
||||
if (empty($event)) {
|
||||
throw new NotFoundException('Invalid Event.');
|
||||
}
|
||||
$this->NotificationLog = ClassRegistry::init('NotificationLog');
|
||||
if (!$this->NotificationLog->check($event[0]['Event']['orgc_id'], 'publish')) {
|
||||
if ($processId) {
|
||||
|
@ -2906,9 +2909,6 @@ class Event extends AppModel
|
|||
}
|
||||
return true;
|
||||
}
|
||||
if (empty($event)) {
|
||||
throw new MethodNotFoundException('Invalid Event.');
|
||||
}
|
||||
$userConditions = array('autoalert' => 1);
|
||||
$this->User = ClassRegistry::init('User');
|
||||
$users = $this->User->getUsersWithAccess(
|
||||
|
|
|
@ -51,7 +51,7 @@ class EventDelegation extends AppModel
|
|||
{
|
||||
$event = $this->Event->fetchEvent($user, array('eventid' => $delegation['EventDelegation']['event_id']));
|
||||
if (empty($event)) {
|
||||
throw new MethodNotFoundException('Invalid event.');
|
||||
throw new NotFoundException('Invalid event.');
|
||||
}
|
||||
$event = $event[0];
|
||||
$event['Event']['user_id'] = $user['id'];
|
||||
|
|
|
@ -574,7 +574,7 @@ class Sighting extends AppModel
|
|||
|
||||
if (!isset($this->validFormats[$returnFormat])) {
|
||||
// this is where the new code path for the export modules will go
|
||||
throw new MethodNotFoundException('Invalid export format.');
|
||||
throw new NotFoundException('Invalid export format.');
|
||||
}
|
||||
|
||||
$exportToolParams = array(
|
||||
|
|
Loading…
Reference in New Issue