chg: [internal] Remove unused to_ids from AttributesController::fetchViewValue

pull/8613/head
Jakub Onderka 2022-09-29 16:11:43 +02:00
parent 5db7fd1bf7
commit 38513b7060
2 changed files with 2 additions and 10 deletions

View File

@ -1961,7 +1961,7 @@ class AttributesController extends AppController
public function fetchViewValue($id, $field = null)
{
$user = $this->_closeSession();
$validFields = ['value', 'comment', 'type', 'category', 'to_ids', 'distribution', 'timestamp', 'first_seen', 'last_seen'];
$validFields = ['value', 'comment', 'type', 'category', 'distribution', 'timestamp', 'first_seen', 'last_seen'];
if (!isset($field) || !in_array($field, $validFields, true)) {
throw new MethodNotAllowedException(__('Invalid field requested.'));
}
@ -1990,8 +1990,6 @@ class AttributesController extends AppController
$result = $attribute['Attribute'][$field];
if ($field === 'distribution') {
$result = $this->Attribute->shortDist[$result];
} elseif ($field === 'to_ids') {
$result = $result == 0 ? 'No' : 'Yes';
} elseif ($field === 'value') {
$this->loadModel('Warninglist');
$attribute['Attribute'] = $this->Warninglist->checkForWarning($attribute['Attribute']);

View File

@ -4,11 +4,5 @@ if ($field === 'value') {
} elseif ($field === 'timestamp') {
echo $this->Time->date($value);
} else {
if ($value === 'No') {
echo '<input type="checkbox" disabled>';
} else if ($value === 'Yes') {
echo '<input type="checkbox" checked disabled>';
} else {
echo nl2br(h($value), false);
}
echo nl2br(h($value), false);
}