You are here

public function FilePermissions::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/FilePermissions.php, line 138

Class

FilePermissions
Check that files aren't writeable by the server.

Namespace

Drupal\security_review\Checks

Code

public function evaluatePlain(CheckResult $result) {
  if ($result
    ->result() == CheckResult::SUCCESS) {
    return '';
  }
  $output = $this
    ->t('Writable files:') . "\n";
  foreach ($result
    ->findings() as $file) {
    $output .= "\t" . $file . "\n";
  }
  return $output;
}