mirror of https://github.com/MISP/MISP
fix: [factories] links and timestamps fixed
- really annoying timestamp issue - as discovered during LS21pull/7355/head
parent
a9efb7a551
commit
6c3dc5e0d5
|
@ -18,16 +18,13 @@
|
|||
$url_param_data_paths = implode('/', $temp);
|
||||
} else {
|
||||
$url_param_data_paths = Hash::extract($row, $field['url_params_data_paths']);
|
||||
if (!empty($url_param_data_paths)) {
|
||||
$url_param_data_paths = $url_param_data_paths[0];
|
||||
} else {
|
||||
if (empty($url_param_data_paths)) {
|
||||
$url_param_data_paths = '';
|
||||
}
|
||||
}
|
||||
$urlWithData .= '/' . $url_param_data_paths;
|
||||
}
|
||||
$links = array();
|
||||
foreach ($data_elements as $data) {
|
||||
foreach ($data_elements as $k => $data) {
|
||||
if (!empty($data['name'])) {
|
||||
$field['title'] = $data['name'];
|
||||
}
|
||||
|
@ -40,6 +37,13 @@
|
|||
$data
|
||||
);
|
||||
} elseif (!empty($field['url_params_data_paths'])) {
|
||||
if (!empty($url_param_data_paths)) {
|
||||
if (is_array($url_param_data_paths)) {
|
||||
$urlWithData .= '/' . $url_param_data_paths[$k];
|
||||
} else {
|
||||
$urlWithData .= '/' . $url_param_data_paths;
|
||||
}
|
||||
}
|
||||
$url = $urlWithData;
|
||||
} else {
|
||||
$url = $data;
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
$offset = ceil($offset / 60);
|
||||
$unit = 'minute(s)';
|
||||
$colour = 'orange';
|
||||
}
|
||||
if ($offset >= 60) {
|
||||
$offset = ceil($offset / 60);
|
||||
$unit = 'hour(s)';
|
||||
$colour = 'green';
|
||||
}
|
||||
if ($offset >= 24) {
|
||||
$offset = ceil($offset / 24);
|
||||
$unit = 'day(s)';
|
||||
if ($offset >= 60) {
|
||||
$offset = ceil($offset / 60);
|
||||
$unit = 'hour(s)';
|
||||
$colour = 'green';
|
||||
if ($offset >= 24) {
|
||||
$offset = floor($offset / 24);
|
||||
$unit = 'day(s)';
|
||||
}
|
||||
}
|
||||
}
|
||||
$raw = true;
|
||||
$timestamp = sprintf('<span class="bold %s">%s %s ago</span>', $colour, $offset, $unit);
|
||||
|
|
Loading…
Reference in New Issue