Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: MimeType:validate finfo error #16647

Closed
niden opened this issue Sep 16, 2024 · 1 comment
Closed

[BUG]: MimeType:validate finfo error #16647

niden opened this issue Sep 16, 2024 · 1 comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium

Comments

@niden
Copy link
Member

niden commented Sep 16, 2024

$this->add(
            (new File('file',['required' => true]))
                ->setLabel('Attach sample op-ed(available format:pdf,text,word):')
                ->addValidators([
                    new PresenceOf([
                        'message' => 'please upload an op-ed file',
                    ]),
                    new MimeType([
                        "types" => [
                            'application/pdf',
                            'application/msword',
                            'application/rtf',
                            'application/epub+zip',
                            'text/plain',
                        ],
                        "message" => "Allowed file types are :types"
                    ]),
                   new Max([
                        "size"     => "2M",
                        "included" => true,
                        "message"  => ":field exceeds the max size (:size)",
                    ])
                ])
        );

Error: Fatal error: Uncaught ValueError: finfo_file(): Argument #1 ($finfo) cannot be empty in...

Report and fix by https://github.com/zikezhang

@niden niden added bug A bug report status: medium Medium 5.0 The issues we want to solve in the 5.0 release labels Sep 16, 2024
@niden niden added this to Phalcon v5 Sep 16, 2024
@niden niden mentioned this issue Sep 16, 2024
5 tasks
@niden niden moved this to Implemented in Phalcon v5 Sep 16, 2024
@niden
Copy link
Member Author

niden commented Sep 16, 2024

Resolved in #16646

@niden niden closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report status: medium Medium
Projects
Status: Implemented
Development

No branches or pull requests

1 participant