pingcrm
pingcrm copied to clipboard
Improve file upload
Changes:
- remove support for SVG file:
Even though Laravel accepts SVG as valid image type, SVG files are not displayed correctly in the app right now. For URL such as
http://localhost:8081/img/users/1WWm9JJumSkEwhIIZYohNtrL2GYQtxBGAPJIoXgW.svg?w=40&h=40&fit=crop,500 Internal Server Erroroccurs with following message:
Also, Laravel has stopped supporting SVG files forUnsupported image type image/svg+xml. GD driver is only able to decode JPG, PNG, GIF, BMP or WebP files.imagevalidation rule starting from version 12. Following message is displayed in https://laravel.com/docs/12.x/validation#rule-image :
So, it makes sense to remove support for SVG file in the app.By default, the image rule does not allow SVG files due to the possibility of XSS vulnerabilities. If you need to allow SVG files, you may provide the allow_svg directive to the image rule (image:allow_svg). - remove useless attribute:
type="file"was used with<file-input>which is useless. - fix: file-input validation error not showing: Validation error for photo field in Users/Create and Users/Edit was not working which has been fixed.