You are here

public function UploadExtensions::getMessage in Security Review 8

Converts a result integer to a human-readable result message.

Parameters

int $result_const: The result integer.

Return value

string The human-readable result message.

Overrides Check::getMessage

File

src/Checks/UploadExtensions.php, line 170

Class

UploadExtensions
Checks for unsafe extensions in the allowed extensions settings of fields.

Namespace

Drupal\security_review\Checks

Code

public function getMessage($result_const) {
  switch ($result_const) {
    case CheckResult::SUCCESS:
      return $this
        ->t('Only safe extensions are allowed for uploaded files and images.');
    case CheckResult::FAIL:
      return $this
        ->t('Unsafe file extensions are allowed in uploads.');
    case CheckResult::INFO:
      return $this
        ->t('Module field is not enabled.');
    default:
      return $this
        ->t('Unexpected result.');
  }
}