public function PrivateFiles::evaluate in Security Review 8
Returns the evaluation page of a result.
Usually this is a list of the findings and an explanation.
Parameters
\Drupal\security_review\CheckResult $result: The check result to evaluate.
Return value
array The render array of the evaluation page.
Overrides Check::evaluate
File
- src/
Checks/ PrivateFiles.php, line 68
Class
- PrivateFiles
- Checks whether the private files' directory is under the web root.
Namespace
Drupal\security_review\ChecksCode
public function evaluate(CheckResult $result) {
if ($result
->result() != CheckResult::FAIL) {
return [];
}
$paragraphs = [];
$paragraphs[] = $this
->t('Your files directory is not outside of the server root.');
$paragraphs[] = Link::createFromRoute($this
->t('Edit the files directory path.'), 'system.file_system_settings');
return [
'#theme' => 'check_evaluation',
'#paragraphs' => $paragraphs,
'#items' => [],
];
}