<commit_before><?php
  $sigDisplay = $object['value'];
  if ('attachment' == $object['type'] || 'malware-sample' == $object['type'] ) {
    if ($object['type'] == 'attachment' && isset($object['image'])) {
      $extension = explode('.', $object['value']);
      $extension = end($extension);
      $uri = 'data:image/' . strtolower(h($extension)) . ';base64,' . h($object['image']);
      echo '<img class="screenshot screenshot-collapsed useCursorPointer" src="' . $uri . '" title="' . h($object['value']) . '" />';
    } else {
      $filenameHash = explode('|', nl2br(h($object['value'])));
      if (strrpos($filenameHash[0], '\\')) {
        $filepath = substr($filenameHash[0], 0, strrpos($filenameHash[0], '\\'));
        $filename = substr($filenameHash[0], strrpos($filenameHash[0], '\\'));
        echo h($filepath);
        echo '<a href="' . $baseurl . '/attributes/download/' . h($object['id']) . '" class="' . $linkClass . '">' . h($filename) . '</a>';
      } else {
        echo '<a href="' . $baseurl . '/attributes/download/' . h($object['id']) . '" class="' . $linkClass . '">' . h($filenameHash[0]) . '</a>';
      }
      if (isset($filenameHash[1])) echo '<br />' . $filenameHash[1];
    }
  } else if (strpos($object['type'], '|') !== false) {
    $separator = in_array($object['type'], array('ip-dst|port', 'ip-src|port')) ? ':' : '<br />';
    $value_pieces = explode('|', $object['value']);
    foreach ($value_pieces as $k => $v) {
      $value_pieces[$k] = h($v);
    }
    $object['value'] = implode($separator, $value_pieces);
    echo ($object['value']);
  } else if ('vulnerability' == $object['type']) {
    $cveUrl = (is_null(Configure::read('MISP.cveurl'))) ? "http://www.google.com/search?q=" : Configure::read('MISP.cveurl');
    echo $this->Html->link($sigDisplay, $cveUrl . $sigDisplay, array('target' => '_blank', 'class' => $linkClass));
  } else if ('link' == $object['type']) {
    echo $this->Html->link($sigDisplay, $sigDisplay, array('class' => $linkClass));
  } else if ('cortex' == $object['type']) {
    echo '<div class="cortex-json" data-cortex-json="' . h($object['value']) . '">Cortex object</div>';
  } else if ('text' == $object['type']) {
    if ($object['category'] == 'External analysis' && preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i', $object['value'])) {
      echo '<a href="' . $baseurl . '/events/view/' . h($object['value']) . '" class="' . $linkClass . '">' . h($object['value']) . '</a>';
    } else {
      $sigDisplay = str_replace("\r", '', h($sigDisplay));
      $sigDisplay = str_replace(" ", '&nbsp;', $sigDisplay);
      echo nl2br($sigDisplay);
    }
  } else if ('hex' == $object['type']) {<commit_msg>fix: Internal reference: type with a uuid of an event converts to a clickable link<commit_after><?php
  $sigDisplay = $object['value'];
  if ('attachment' == $object['type'] || 'malware-sample' == $object['type'] ) {
    if ($object['type'] == 'attachment' && isset($object['image'])) {
      $extension = explode('.', $object['value']);
      $extension = end($extension);
      $uri = 'data:image/' . strtolower(h($extension)) . ';base64,' . h($object['image']);
      echo '<img class="screenshot screenshot-collapsed useCursorPointer" src="' . $uri . '" title="' . h($object['value']) . '" />';
    } else {
      $filenameHash = explode('|', nl2br(h($object['value'])));
      if (strrpos($filenameHash[0], '\\')) {
        $filepath = substr($filenameHash[0], 0, strrpos($filenameHash[0], '\\'));
        $filename = substr($filenameHash[0], strrpos($filenameHash[0], '\\'));
        echo h($filepath);
        echo '<a href="' . $baseurl . '/attributes/download/' . h($object['id']) . '" class="' . $linkClass . '">' . h($filename) . '</a>';
      } else {
        echo '<a href="' . $baseurl . '/attributes/download/' . h($object['id']) . '" class="' . $linkClass . '">' . h($filenameHash[0]) . '</a>';
      }
      if (isset($filenameHash[1])) echo '<br />' . $filenameHash[1];
    }
  } else if (strpos($object['type'], '|') !== false) {
    $separator = in_array($object['type'], array('ip-dst|port', 'ip-src|port')) ? ':' : '<br />';
    $value_pieces = explode('|', $object['value']);
    foreach ($value_pieces as $k => $v) {
      $value_pieces[$k] = h($v);
    }
    $object['value'] = implode($separator, $value_pieces);
    echo ($object['value']);
  } else if ('vulnerability' == $object['type']) {
    $cveUrl = (is_null(Configure::read('MISP.cveurl'))) ? "http://www.google.com/search?q=" : Configure::read('MISP.cveurl');
    echo $this->Html->link($sigDisplay, $cveUrl . $sigDisplay, array('target' => '_blank', 'class' => $linkClass));
  } else if ('link' == $object['type']) {
    echo $this->Html->link($sigDisplay, $sigDisplay, array('class' => $linkClass));
  } else if ('cortex' == $object['type']) {
    echo '<div class="cortex-json" data-cortex-json="' . h($object['value']) . '">Cortex object</div>';
  } else if ('text' == $object['type']) {
    if (($object['category'] == 'Internal reference' || $object['category'] == 'External analysis') && preg_match('/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/i', $object['value'])) {
      echo '<a href="' . $baseurl . '/events/view/' . h($object['value']) . '" class="' . $linkClass . '">' . h($object['value']) . '</a>';
    } else {
      $sigDisplay = str_replace("\r", '', h($sigDisplay));
      $sigDisplay = str_replace(" ", '&nbsp;', $sigDisplay);
      echo nl2br($sigDisplay);
    }
  } else if ('hex' == $object['type']) {
{'fraction_non_alphanumeric': 0.27166064981949456, 'fraction_numerical': 0.010469314079422382, 'mean_word_length': 3.703735144312394, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5517171', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1892, 'n_words': 349}