{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/11795","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/11795/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11795/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/11795/events","html_url":"https://github.com/yiisoft/yii2/issues/11795","id":161512985,"number":11795,"title":"Mobi filetype upload failure","user":{"login":"cleippi","id":13521443,"avatar_url":"https://avatars.githubusercontent.com/u/13521443?v=3","gravatar_id":"","url":"https://api.github.com/users/cleippi","html_url":"https://github.com/cleippi","followers_url":"https://api.github.com/users/cleippi/followers","following_url":"https://api.github.com/users/cleippi/following{/other_user}","gists_url":"https://api.github.com/users/cleippi/gists{/gist_id}","starred_url":"https://api.github.com/users/cleippi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleippi/subscriptions","organizations_url":"https://api.github.com/users/cleippi/orgs","repos_url":"https://api.github.com/users/cleippi/repos","events_url":"https://api.github.com/users/cleippi/events{/privacy}","received_events_url":"https://api.github.com/users/cleippi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:need%20more%20info","name":"status:need more info","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-21T18:54:09Z","updated_at":"2016-06-22T17:35:40Z","closed_at":null,"body":"### What steps will reproduce the problem?\r\n\r\nCreating a file input type with extension mobi, such as:\r\n\r\n```\r\npublic function rules()\r\n    {\r\n        return [\r\n            [['mobiFile'], 'file', 'extensions' => 'mobi'],\r\n            [['epubFile'], 'file', 'extensions' => 'epub'],\r\n            [['pdfFile'], 'file', 'extensions' => 'pdf'],\r\n        ];\r\n    }\r\n```\r\n\r\nThen going and uploading a file with extension mobi. epub and pdf work just fine.\r\n\r\n### What is the expected result?\r\n\r\nThe file should upload without any error\r\n\r\n### What do you get instead?\r\n\r\nAn error message:\r\n\r\n> Only files with these extensions are allowed: mobi.\r\n\r\n### Additional info\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.8\r\n| PHP version      | 5.6.15\r\n| Operating system | Windows 8.1\r\n\r\nI also checked in the mimetypes and mobi is there, so I'm not sure why this is not working.\r\nhttps://github.com/yiisoft/yii2/blob/master/framework/helpers/mimeTypes.php\r\n\r\nUsing a rule such as the following solves the problem, but from what I've read this sounds like it might introduce security vulnerabilities so I'm weary to leave it this way\r\n\r\n`[['mobiFile'], 'file', 'extensions' => 'mobi', 'checkExtensionByMimeType' => false],`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/227819395","html_url":"https://github.com/yiisoft/yii2/issues/11795#issuecomment-227819395","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/11795","id":227819395,"user":{"login":"cleippi","id":13521443,"avatar_url":"https://avatars.githubusercontent.com/u/13521443?v=3","gravatar_id":"","url":"https://api.github.com/users/cleippi","html_url":"https://github.com/cleippi","followers_url":"https://api.github.com/users/cleippi/followers","following_url":"https://api.github.com/users/cleippi/following{/other_user}","gists_url":"https://api.github.com/users/cleippi/gists{/gist_id}","starred_url":"https://api.github.com/users/cleippi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cleippi/subscriptions","organizations_url":"https://api.github.com/users/cleippi/orgs","repos_url":"https://api.github.com/users/cleippi/repos","events_url":"https://api.github.com/users/cleippi/events{/privacy}","received_events_url":"https://api.github.com/users/cleippi/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T17:35:40Z","updated_at":"2016-06-22T17:35:40Z","body":"Here's an example file (had to zip it because mobi upload isn't supported):\r\n[mobi example.zip](https://github.com/yiisoft/yii2/files/328413/mobi.example.zip)\r\n\r\nAlso, as for the list of mime types, is this the one?\r\nhttps://github.com/yiisoft/yii2/blob/master/framework/helpers/mimeTypes.php\r\nIf so, then it should be there because my local file is the same."}}
{"actor":{"display_login":"cleippi"}}