Skip to content

3.5.0-rc.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@bastianallgeier bastianallgeier released this 08 Dec 15:20

All the good stuff from:

and …

More detailed accept options for file blueprints

Previously, file blueprints could be configured to only allow specific MIME types to be uploaded.

  • It is now possible to limit the uploaded files based on the file extension and/or the file type.
accept:
  extension: jpg, png
accept:
  type: image, audio, video
  • These restrictions can be combined with a custom set of MIME types. This makes it possible to define MIME types that are compatible with all browsers while still protecting the uploads based on the extension and/or file type:
accept:
  mime: image/*
  type: image

In this example, Kirby will generate a file upload input with an accept="image/*" attribute and will then validate both the MIME type and the detected file type on the server after the file is uploaded.

  • If no restrictions are defined in the file blueprint, Kirby will now limit the accepted uploads to the types image, document, archive, audio and video by default. This protects your sites against unexpected uploads like code files that could be used to attack the server or the visitor's browsers.

  • You can disable the automatic types and allow all uploads like this:

accept: true

# or:
accept:
  mime: null
  orientation: square
  ...
  • New F::typeToExtensions() method

Enhancements

  • Open table block on dblclick instead of single click
  • Add props docs to writer and list fields
  • Support import of em marks
  • New set of default ratios for the image block
  • Updated languages (ko, id, it)

Fixes

  • Fixed the saved value for empty lists #2976
  • Fixed raw HTML parsing in Blocks::parse() #2972
  • Fixed empty text option for blocks/layout field
  • Fixed prev/next arrow bug
  • Fixed code block snippet
  • Don't load login form if logged in