mirror of https://github.com/MISP/MISP
Colouring of search terms works in links
- links now have proper colouring to make the found terms more visiblepull/63/head
parent
036308bc0e
commit
4a368918eb
|
@ -820,9 +820,10 @@ class AttributesController extends AppController {
|
|||
$attribute['Attribute']['value'] = str_replace('\n', chr(10), $attribute['Attribute']['value']);
|
||||
foreach ($keywordArray as $keywordArrayElement) {
|
||||
$keywordArrayElement = trim($keywordArrayElement);
|
||||
if ($attribute['Attribute']['type'] != 'malware-sample' && $attribute['Attribute']['type'] != 'link' && $attribute['Attribute']['type'] != 'attachment') {
|
||||
$attribute['Attribute']['value'] = preg_replace('%'.$keywordArrayElement.'%i', '<span style="color:red">'.$keywordArrayElement.'</span>', $attribute['Attribute']['value']);
|
||||
if ($attribute['Attribute']['type'] == 'malware-sample' || $attribute['Attribute']['type'] == 'link' || $attribute['Attribute']['type'] == 'attachment') {
|
||||
$attribute['Attribute']['valueNoScript'] = preg_replace('%'.$keywordArrayElement.'%i', $keywordArrayElement, $attribute['Attribute']['value']);
|
||||
}
|
||||
$attribute['Attribute']['value'] = preg_replace('%'.$keywordArrayElement.'%i', '<span style="color:red">'.$keywordArrayElement.'</span>', $attribute['Attribute']['value']);
|
||||
}
|
||||
}
|
||||
$this->set('attributes', $attributes);
|
||||
|
|
|
@ -854,7 +854,7 @@ class Attribute extends AppModel {
|
|||
if (PHP_OS == 'WINNT') {
|
||||
$rootDir = APP . "files" . DS . $eventId;
|
||||
} else {
|
||||
$rootDir = APP . DS . "files" . DS . $eventId;
|
||||
$rootDir = APP . "files" . DS . $eventId;
|
||||
}
|
||||
$dir = new Folder($rootDir, true);
|
||||
// move the file to the correct location
|
||||
|
|
|
@ -56,9 +56,9 @@ foreach ($attributes as $attribute): ?>
|
|||
<?php
|
||||
$sigDisplay = nl2br(($attribute['Attribute']['value']));
|
||||
if ('attachment' == $attribute['Attribute']['type'] || 'malware-sample' == $attribute['Attribute']['type']) {
|
||||
echo $this->Html->link($sigDisplay, array('controller' => 'attributes', 'action' => 'download', $attribute['Attribute']['id']));
|
||||
echo $this->Html->link($sigDisplay, array('controller' => 'attributes', 'action' => 'download', $attribute['Attribute']['id']), array('escape' => FALSE));
|
||||
} elseif ('link' == $attribute['Attribute']['type']) {
|
||||
echo $this->Html->link($sigDisplay, $sigDisplay);
|
||||
echo $this->Html->link($sigDisplay, nl2br($attribute['Attribute']['valueNoScript']), array('escape' => FALSE));
|
||||
} else {
|
||||
echo $sigDisplay;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue