milesj / uploader

[Deprecated] A CakePHP plugin for file uploading and validating.
MIT License
193 stars 73 forks source link

Bypassing validation #191

Open aiphee opened 9 years ago

aiphee commented 9 years ago

Hi, i have this rule:

        public $actsAs = array( 
                                'Uploader.Attachment'     => array(
                                    'image_url' => array(
                                    )
                                ),

                                'Uploader.FileValidation' => array(
                                    'image_url' => array(
                                        'required'  => false,
                                        'extension' => array(
                                            'value' => array('jpg', 'jpeg'),
                                            'error' => 'Invalid extension'
                                        ),
                                        'mimeType'  => array(
                                            'value' => array('image/jpeg'),
                                            'error' => 'Invalid mime type'
                                        ),
                                        'type'      => array(
                                            'value' => 'image',
                                            'error' => 'Invalid type'
                                        )
                                    )
                                )
        );

But when i try to Upload renamed font.ttf to font.jpg, it stil uploads, m i doing something wrong?