shows spaces in attribute value. fixes #19

pull/217/head
Christophe Vandeplas 2013-06-19 11:05:34 +02:00
parent 8df300221e
commit 136b929801
3 changed files with 21 additions and 46 deletions

View File

@ -69,21 +69,20 @@ foreach ($attributes as $attribute):
<?php echo $attribute['Attribute']['category']; ?>&nbsp;</td>
<td title="<?php echo $typeDefinitions[$attribute['Attribute']['type']]['desc'];?>" class="short" onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['type']; ?>&nbsp;</td>
<td onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php
$sigDisplay = nl2br(h($attribute['Attribute']['value']));
if ($isSearch == 1 && !empty($replacePairs)) {
// highlight the keywords if there are any
$sigDisplay = $this->Highlight->highlighter($sigDisplay, $replacePairs);
}
if ('attachment' == $attribute['Attribute']['type'] || 'malware-sample' == $attribute['Attribute']['type']) {
?><a href="/attributes/download/<?php echo $attribute['Attribute']['id'];?>"><?php echo $sigDisplay; ?></a><?php
} elseif ('link' == $attribute['Attribute']['type']) {
?><a href="<?php echo nl2br(h($attribute['Attribute']['value']));?>"><?php echo $sigDisplay; ?></a><?php
} else {
echo $sigDisplay;
}
?>&nbsp;</td>
<td class="showspaces" onclick="document.location='/events/view/<?php echo $attribute['Event']['id'];?>';"><?php
$sigDisplay = nl2br(h($attribute['Attribute']['value']));
if ($isSearch == 1 && !empty($replacePairs)) {
// highlight the keywords if there are any
$sigDisplay = $this->Highlight->highlighter($sigDisplay, $replacePairs);
}
if ('attachment' == $attribute['Attribute']['type'] || 'malware-sample' == $attribute['Attribute']['type']) {
?><a href="/attributes/download/<?php echo $attribute['Attribute']['id'];?>"><?php echo $sigDisplay; ?></a><?php
} elseif ('link' == $attribute['Attribute']['type']) {
?><a href="<?php echo nl2br(h($attribute['Attribute']['value']));?>"><?php echo $sigDisplay; ?></a><?php
} else {
echo $sigDisplay;
}
?></td>
<td class="short" onclick="document.location ='document.location ='/events/view/<?php echo $attribute['Event']['id'];?>';">
<?php echo $attribute['Attribute']['to_ids'] ? 'Yes' : 'No'; ?>&nbsp;
</td>

View File

@ -171,7 +171,7 @@ if (!empty($event['Attribute'])):?>
<?php echo h($attribute['type']);?>
</td>
<td class="<?php echo $extra; ?>"><?php
<td class="showspaces <?php echo $extra; ?>"><?php
$sigDisplay = $attribute['value'];
if ('attachment' == $attribute['type'] || 'malware-sample' == $attribute['type'] ) {
$filenameHash = explode('|', $attribute['value']);
@ -249,8 +249,7 @@ if (!empty($event['Attribute'])):?>
if ($shadowAttribute['type'] != $attribute['type']) echo h($shadowAttribute['type']);
?>
</td>
<td class = "highlight2">
<?php
<td class="showspaces highlight2"><?php
if ($shadowAttribute['value'] != $attribute['value']) {
$sigDisplay = $shadowAttribute['value'];
if ('attachment' == $shadowAttribute['type'] || 'malware-sample' == $shadowAttribute['type'] ) {
@ -276,8 +275,7 @@ if (!empty($event['Attribute'])):?>
echo h($sigDisplay);
}
}
?>
</td>
?></td>
<td class="short highlight2">
</td>
<td class="short highlight2">
@ -325,8 +323,7 @@ if (!empty($event['Attribute'])):?>
echo h($remain['type']);
?>
</td>
<td class = "short highlight2">
<?php
<td class="showspaces short highlight2"><?php
$sigDisplay = nl2br(h($remain['value']));
if ('attachment' == $remain['type'] || 'malware-sample' == $remain['type'] ) {
$filenameHash = explode('|', $remain['value']);
@ -350,8 +347,7 @@ if (!empty($event['Attribute'])):?>
} else {
echo h($sigDisplay);
}
?>
</td>
?></td>
<td class="short highlight2">
</td>
<td class="short highlight2">

View File

@ -284,29 +284,9 @@ td.action-links {
text-align: right;
}
/*
.view_icon{
background-position: 0 0;
}
.edit_icon{
background-position: -17px 0;
.showspaces {
white-space: pre-wrap;
}
.delete_icon{
background-position: -34px 0;
}
.tick_icon{
width: 16px;
height: 16px;
display: block;
background: url('../img/icons/icons-trans.png') -51px 0 no-repeat;
}
.cross_icon{
width: 16px;
height: 16px;
display: block;
background: url('../img/icons/icons-trans.png') -67px 0 no-repeat;
}
*/
/** Scaffold View **/
dl {