mirror of https://github.com/MISP/MISP
fix: Relaxed UUID4 requirement for UUID validation
- we shouldn't enforce anything beyond the basic formatpull/2260/head
parent
551afac9f4
commit
1e61074115
|
@ -429,12 +429,8 @@ class Attribute extends AppModel {
|
|||
),
|
||||
'uuid' => array(
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
),
|
||||
'unique' => array(
|
||||
'rule' => 'isUnique',
|
||||
|
|
|
@ -246,12 +246,8 @@ class Event extends AppModel {
|
|||
),
|
||||
'uuid' => array(
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
//'message' => 'Your custom message here',
|
||||
//'allowEmpty' => false,
|
||||
//'required' => false,
|
||||
//'last' => false, // Stop validation after this rule
|
||||
//'on' => 'create', // Limit validation to 'create' or 'update' operations
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -22,8 +22,8 @@ class OrgBlacklist extends AppModel{
|
|||
'message' => 'Organisation already blacklisted.'
|
||||
),
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
|
|
@ -31,8 +31,8 @@ class Organisation extends AppModel{
|
|||
'rule' => 'isUnique',
|
||||
'message' => 'An organisation with this UUID already exists.'
|
||||
),
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
'simpleuuid' => array(
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID',
|
||||
'allowEmpty' => true
|
||||
),
|
||||
|
@ -125,7 +125,6 @@ class Organisation extends AppModel{
|
|||
'recursive' => -1,
|
||||
'conditions' => $conditions,
|
||||
));
|
||||
|
||||
if (empty($existingOrg)) {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$organisation = array(
|
||||
|
|
|
@ -118,7 +118,8 @@ class ShadowAttribute extends AppModel {
|
|||
),
|
||||
'uuid' => array(
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
),
|
||||
),
|
||||
'proposal_to_delete' => array(
|
||||
|
|
|
@ -24,7 +24,7 @@ class SharingGroup extends AppModel {
|
|||
),
|
||||
'uuid' => array(
|
||||
'uuid' => array(
|
||||
'rule' => array('uuid'),
|
||||
'rule' => array('custom', '/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
|
||||
'message' => 'Please provide a valid UUID'
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue