镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Validation problem with rule MIME_TYPE #302

Description

@Marian-Kechlibar

Version: 3.1.11

Bug Description

I need to verify whether a file upload MIME type is actually one of a list of types. The resulting error message is unhelpful.

Steps To Reproduce

addRule($form::MIME_TYPE, $form->getTranslator()->translate('kraken.error.filemustbeoftypewithvalue', array('type' => AlgorithmsAndTypes::TYPE_TEXT_PLAIN)),
                array(AlgorithmsAndTypes::TYPE_TEXT_PLAIN, AlgorithmsAndTypes::TYPE_PEM_ENCODED_FILE , AlgorithmsAndTypes::TYPE_X509_USER_CERT))

where kraken.error.filemustbeoftypewithvalue is defined in NEON translation file as

'Nepodporovaný typ souboru %value.'

The resulting error message is

Nepodporovaný typ souboru [object FileList].

Which does not tell me what MIME type was actually detected by the validator.

Expected Behavior

I would expect an error message that told me exactly what MIME type was detected:

Nepodporovaný typ souboru text/html.

etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions