mirror of https://github.com/MISP/MISP
fix an php error when importing attributes with incorrect type -
category validationpull/61/head
parent
3bec9bbefc
commit
7cea666c9b
|
@ -139,6 +139,8 @@ class ServersController extends AppController {
|
|||
|
||||
|
||||
public function pull($id = null, $full=false) {
|
||||
// TODO should we de-activate data validation for type and category / and or mapping? Maybe other instances have other configurations that are incompatible.
|
||||
|
||||
if (!$this->request->is('post')) {
|
||||
throw new MethodNotAllowedException();
|
||||
}
|
||||
|
|
|
@ -354,7 +354,9 @@ class Attribute extends AppModel {
|
|||
|
||||
function validateTypeValue($fields) {
|
||||
$category = $this->data['Attribute']['category'];
|
||||
return in_array($fields['type'], $this->category_definitions[$category]['types']);
|
||||
if (isset($this->category_definitions[$category]['types']))
|
||||
return in_array($fields['type'], $this->category_definitions[$category]['types']);
|
||||
return false;
|
||||
}
|
||||
|
||||
function validateAttributeValue ($fields) {
|
||||
|
|
Loading…
Reference in New Issue