0

In entity browser I tried uploading a file which is not supported. So I got the valid error message.
But it does not convert the html tags which are being generated from token. Following is the code from core File module.

function file_validate_extensions(FileInterface $file, $extensions) {
  $errors = [];  
  $regex = '/\.(' . preg_replace('/ +/', '|', preg_quote($extensions)) . ')$/i';
  if (!preg_match($regex, $file->getFilename())) {
    $errors[] = t('Only files with the following extensions are allowed: %files-allowed.', ['%files-allowed' => $extensions]);
  }
  return $errors;
}

This error message when searched in translations is shown as:

Only files with the following extensions are allowed: %files-allowed.

which is perfectly fine.
But this is how it is being displayed on page:

error message

How to debug this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.