mirror of https://github.com/MISP/MISP
fix: [component:restSearch] Restored behavior of searching for org and cluster metadata
parent
05be803393
commit
004b18e1d9
|
@ -1033,7 +1033,19 @@ class AppController extends Controller
|
|||
$data = array_merge($data, $temp);
|
||||
} else {
|
||||
foreach ($options['paramArray'] as $param) {
|
||||
if (isset($temp[$param])) {
|
||||
if (substr($param, -1) == '*') {
|
||||
$root = substr($param, 0, strlen($param)-1);
|
||||
foreach ($temp as $existingParamKey => $v) {
|
||||
$leftover = substr($existingParamKey, strlen($param)-1);
|
||||
if (
|
||||
$root == substr($existingParamKey, 0, strlen($root)) &&
|
||||
preg_match('/^[\w_-. ]+$/', $leftover) == 1
|
||||
) {
|
||||
$data[$existingParamKey] = $temp[$existingParamKey];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (isset($temp[$param])) {
|
||||
$data[$param] = $temp[$param];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,11 @@ class RestSearchComponent extends Component
|
|||
'retry',
|
||||
'expiry',
|
||||
'minimum_ttl',
|
||||
'ttl'
|
||||
'ttl',
|
||||
'org.sector',
|
||||
'org.local',
|
||||
'org.nationality',
|
||||
'galaxy.*',
|
||||
],
|
||||
'Object' => [
|
||||
'returnFormat',
|
||||
|
|
Loading…
Reference in New Issue