mirror of https://github.com/MISP/MISP
commit
e734349f85
|
@ -64,7 +64,7 @@
|
|||
);
|
||||
if (!empty($tag['Tag']['id'])) {
|
||||
$span_tag = sprintf(
|
||||
'<a href="%s" style="%s" class="%s" title="%s" data-tag-id="%s">%s</a>',
|
||||
'<a href="%s" style="%s" class="%s"%s data-tag-id="%s">%s</a>',
|
||||
sprintf(
|
||||
'%s%s%s',
|
||||
$baseurl,
|
||||
|
@ -73,7 +73,7 @@
|
|||
),
|
||||
$aStyle,
|
||||
$aClass,
|
||||
$aText,
|
||||
isset($aTextModified) ? ' title="' . $aText . '"' : '',
|
||||
h($tag['Tag']['id']),
|
||||
isset($aTextModified) ? $aTextModified : $aText
|
||||
);
|
||||
|
|
|
@ -574,10 +574,13 @@ $(function () {
|
|||
queryEventLock('<?= h($event['Event']['id']); ?>', <?= (int)$event['Event']['timestamp'] ?>);
|
||||
popoverStartup();
|
||||
|
||||
$("th, td, dt, div, span, li").tooltip({
|
||||
'placement': 'top',
|
||||
'container' : 'body',
|
||||
$(document.body).tooltip({
|
||||
selector: 'span[title], td[title], time[title]',
|
||||
placement: 'top',
|
||||
container: 'body',
|
||||
delay: { show: 500, hide: 100 }
|
||||
}).on('shown', function() {
|
||||
$('.tooltip').not(":last").remove();
|
||||
});
|
||||
|
||||
$.get("<?php echo $baseurl; ?>/threads/view/<?php echo h($event['Event']['id']); ?>/true", function(data) {
|
||||
|
|
|
@ -3,6 +3,10 @@ App::uses('AppHelper', 'View/Helper');
|
|||
|
||||
class TimeHelper extends AppHelper
|
||||
{
|
||||
/**
|
||||
* @param string|int $time
|
||||
* @return string
|
||||
*/
|
||||
public function time($time)
|
||||
{
|
||||
if (empty($time)) {
|
||||
|
@ -10,9 +14,16 @@ class TimeHelper extends AppHelper
|
|||
}
|
||||
if (is_numeric($time)) {
|
||||
$time = date('Y-m-d H:i:s', $time);
|
||||
} else if (is_string($time)) { // time string with timezone
|
||||
$timezonePosition = strpos($time, '+00:00'); // first and last seen format
|
||||
if ($timezonePosition === false) {
|
||||
$timezonePosition = strpos($time, '+0000'); // datetime attribute format
|
||||
}
|
||||
if ($timezonePosition !== false) {
|
||||
return '<time title="' . __('In UTC') . '">' . h(substr($time, 0, $timezonePosition)) . '</time>';
|
||||
}
|
||||
}
|
||||
|
||||
$time = h($time);
|
||||
return '<time>' . $time . '</time>';
|
||||
return '<time>' . h($time) . '</time>';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue