You are here

public function InputFormats::evaluatePlain in Security Review 8

Evaluates a CheckResult and returns a plaintext output.

Parameters

\Drupal\security_review\CheckResult $result: The check result to evaluate.

Return value

string The evaluation string.

Overrides Check::evaluatePlain

File

src/Checks/InputFormats.php, line 151

Class

InputFormats
Checks for vulnerabilities related to input formats.

Namespace

Drupal\security_review\Checks

Code

public function evaluatePlain(CheckResult $result) {
  $output = '';
  if (!empty($result
    ->findings()['tags'])) {
    $output .= $this
      ->t('Tags') . "\n";
    foreach ($result
      ->findings()['tags'] as $tag) {
      $output .= "\t{$tag}\n";
    }
  }
  if (!empty($result
    ->findings()['formats'])) {
    $output .= $this
      ->t('Formats') . "\n";
    foreach ($result
      ->findings()['formats'] as $format) {
      $output .= "\t{$format}\n";
    }
  }
  return $output;
}